Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package permissions for openSUSE:Factory 
checked in at 2024-03-13 22:15:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/permissions (Old)
 and      /work/SRC/openSUSE:Factory/.permissions.new.1770 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "permissions"

Wed Mar 13 22:15:58 2024 rev:163 rq:1156935 version:1699_20240307

Changes:
--------
--- /work/SRC/openSUSE:Factory/permissions/permissions.changes  2024-03-07 
18:29:00.288102575 +0100
+++ /work/SRC/openSUSE:Factory/.permissions.new.1770/permissions.changes        
2024-03-13 22:16:02.358666883 +0100
@@ -1,0 +2,7 @@
+Mon Mar 11 12:14:10 UTC 2024 - matthias.gerst...@suse.com
+
+- Update to version 1699_20240307:
+  * build system: migrate from Makefile to Meson
+- adjust spec file to meson build
+
+-------------------------------------------------------------------

Old:
----
  permissions-1699_20240305.tar.xz

New:
----
  permissions-1699_20240307.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ permissions.spec ++++++
--- /var/tmp/diff_new_pack.iz9Ppq/_old  2024-03-13 22:16:03.074693224 +0100
+++ /var/tmp/diff_new_pack.iz9Ppq/_new  2024-03-13 22:16:03.074693224 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           permissions
-Version:        1699_20240305
+Version:        1699_20240307
 Release:        0
 Summary:        SUSE Linux Default Permissions
 # Maintained in github by the security team.
@@ -29,6 +29,7 @@
 BuildRequires:  gcc-c++
 BuildRequires:  libcap-devel
 BuildRequires:  libcap-progs
+BuildRequires:  meson
 BuildRequires:  python-rpm-macros
 BuildRequires:  tclap
 # test suite
@@ -41,10 +42,11 @@
 %autosetup
 
 %build
-make %{?_smp_mflags} CXXFLAGS="%{optflags}"
+%meson
+%meson_build
 
 %install
-%make_install fillupdir=%{_fillupdir}
+%meson_install
 # Fix shebang in scripts: Remove dependency on /usr/bin/python3,
 # making scripts to depends on the real python3 binary, not the link.
 # (bsc#1212476)
@@ -56,7 +58,7 @@
 %check
 # will fail on qemu with  unshare: unshare failed: Invalid argument
 %if !0%{?qemu_user_space_build}
-tests/regtest.py --skip-make > /dev/null
+tests/regtest.py --skip-build %_vpath_builddir >/dev/null
 %endif
 
 %description

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.iz9Ppq/_old  2024-03-13 22:16:03.118694843 +0100
+++ /var/tmp/diff_new_pack.iz9Ppq/_new  2024-03-13 22:16:03.122694990 +0100
@@ -1,6 +1,6 @@
 <servicedata>
 <service name="tar_scm">
             <param 
name="url">https://github.com/openSUSE/permissions.git</param>
-          <param 
name="changesrevision">0f100169e4f8602bc90231db383568e58be66609</param></service></servicedata>
+          <param 
name="changesrevision">ceaf1aa2a54de49f590ef80fd6a5fa68a16448a0</param></service></servicedata>
 (No newline at EOF)
 

++++++ permissions-1699_20240305.tar.xz -> permissions-1699_20240307.tar.xz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/permissions-1699_20240305/.gitignore 
new/permissions-1699_20240307/.gitignore
--- old/permissions-1699_20240305/.gitignore    2024-03-05 15:37:29.000000000 
+0100
+++ new/permissions-1699_20240307/.gitignore    2024-03-07 17:26:30.000000000 
+0100
@@ -1,4 +1,3 @@
-chkstat
-*.o
 __pycache__
 .tags
+build*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/permissions-1699_20240305/Makefile 
new/permissions-1699_20240307/Makefile
--- old/permissions-1699_20240305/Makefile      2024-03-05 15:37:29.000000000 
+0100
+++ new/permissions-1699_20240307/Makefile      1970-01-01 01:00:00.000000000 
+0100
@@ -1,74 +0,0 @@
-REQUIRED_CXXFLAGS=-std=c++17 -D_GNU_SOURCE -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -Werror -Wall -Wextra -pedantic -Wduplicated-cond 
-Wduplicated-branches -Wlogical-op -Wnull-dereference -Wdouble-promotion  
-Wshadow  -Wformat=2 -Wsign-conversion
-ifdef CXXFLAGS
-override CXXFLAGS:=$(REQUIRED_CXXFLAGS) $(CXXFLAGS)
-else
-CXXFLAGS=$(REQUIRED_CXXFLAGS) -g -O2
-endif
-ifdef CHKSTAT_TEST
-# for testing, add sanitizers:
-CXXFLAGS+=-fsanitize=address -fsanitize=pointer-compare 
-fsanitize=pointer-subtract -fsanitize=undefined
-endif
-# if debugging is desired then remove optimizations
-ifdef CHKSTAT_DEBUG
-CXXFLAGS+=-O0
-endif
-CXX=g++
-# link statically against libstdc++. since some people are afraid of ABI
-# changes in this area and since permissions is a base package in SUSE this
-# protects us from such potential breakage at the expense of some increased
-# binary size
-REQUIRED_LDFLAGS=-static-libstdc++ -Wl,--as-needed
-ifdef LDFLAGS
-override LDFLAGS:=$(REQUIRED_LDFLAGS) $(LDFLAGS)
-else
-LDFLAGS:=$(REQUIRED_LDFLAGS)
-endif
-DESTDIR=
-LDLIBS=-lcap
-prefix=/usr
-sysconfdir=/etc
-permissionsdir=/usr/share/permissions
-permissionsddir=$(permissionsdir)/permissions.d
-packagesdir=$(permissionsdir)/packages.d
-bindir=$(prefix)/bin
-fillupdir=/var/adm/fillup-templates
-datadir=$(prefix)/share
-mandir=$(datadir)/man
-man8dir=$(mandir)/man8
-man5dir=$(mandir)/man5
-zypp_plugins=$(prefix)/lib/zypp/plugins
-zypp_commit_plugins=$(zypp_plugins)/commit
-
-OBJS = src/chkstat.o src/utility.o src/formatting.o src/cmdline.o src/varexp.o 
src/profparser.o src/entryproc.o
-
-all: src/chkstat
-       @if grep -n -o -P '\t' src/*.cpp src/*.h; then echo "error: source has 
mixed tabs and spaces!" ; touch src/chkstat.cpp ; exit 1 ; fi ; :
-
-install: all
-       @for i in $(bindir) $(man8dir) $(man5dir) $(fillupdir) $(sysconfdir) 
$(permissionsdir) $(permissionsddir) $(packagesdir) $(zypp_commit_plugins); \
-               do install -d -m 755 $(DESTDIR)$$i; done
-       @install -m 755 src/chkstat $(DESTDIR)$(bindir)
-       @install -m 644 man/chkstat.8 $(DESTDIR)$(man8dir)
-       @install -m 644 man/permissions.5 $(DESTDIR)$(man5dir)
-       @install -m 644 etc/sysconfig.security $(DESTDIR)$(fillupdir)
-       @install -m 755 zypper-plugin/permissions.py 
$(DESTDIR)$(zypp_commit_plugins)
-       @for i in etc/variables.conf etc/permissions profiles/permissions.*; \
-               do install -m 644 $$i $(DESTDIR)$(permissionsdir); done
-       @install -m 644 etc/permissions.local $(DESTDIR)$(sysconfdir)
-
-%.o: src/%.cpp
-       $(CXX) $(CXXFLAGS) -c $< -o $@
-
-src/chkstat.o: src/*.h
-src/utility.o: src/utility.h
-
-src/chkstat: $(OBJS) | /usr/include/tclap
-       $(CXX) $(CXXFLAGS) $(LDFLAGS) -osrc/chkstat src/*.o $(LDLIBS)
-
-/usr/include/tclap:
-       @echo "error: The tclap command line parsing library is required for 
building. Try 'zypper in tclap'."; exit 1; :
-
-clean:
-       /bin/rm -f src/chkstat src/*.o
-
-.PHONY: all clean
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/permissions-1699_20240305/README.md 
new/permissions-1699_20240307/README.md
--- old/permissions-1699_20240305/README.md     2024-03-05 15:37:29.000000000 
+0100
+++ new/permissions-1699_20240307/README.md     2024-03-07 17:26:30.000000000 
+0100
@@ -11,6 +11,21 @@
 customize settings. See the accompanying man pages for more detailed
 information.
 
+# Building
+
+This project uses Meson for building. A straightforward build is done like
+this:
+
+    # create a build tree in the build sub-directory
+    meson setup build
+
+    cd build
+    # building of the chkstat program
+    meson compile
+
+    # optional installation
+    meson install
+
 # Known limitations
 
 chkstat doesn't remove permissions that were removed from the profiles. So if
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/permissions-1699_20240305/meson.build 
new/permissions-1699_20240307/meson.build
--- old/permissions-1699_20240305/meson.build   1970-01-01 01:00:00.000000000 
+0100
+++ new/permissions-1699_20240307/meson.build   2024-03-07 17:26:30.000000000 
+0100
@@ -0,0 +1,52 @@
+project('permissions', 'cpp',
+  license: 'gpl2',
+  default_options: ['buildtype=debugoptimized', 'cpp_std=c++17', 
'warning_level=3', 'werror=true'])
+
+
+foreach warning: [ 'duplicated-cond', 'duplicated-branches',
+    'logical-op', 'null-dereference', 'double-promotion', 'shadow',  
'format=2',
+    'sign-conversion']
+  add_global_arguments('-W' + warning, language: 'cpp')
+endforeach
+
+foreach define: ['_GNU_SOURCE', '_LARGEFILE_SOURCE', '_FILE_OFFSET_BITS=64']
+  add_global_arguments('-D' + define, language: 'cpp')
+endforeach
+
+if get_option('testbuild')
+  # NOTE: meson complains that we should consider the built-in 'sanitizers'
+  # option which would need to be passed to the project() declaration. But
+  # then we cannot make this dependent on the 'testbuild' option.
+  # The only other way would be explicitly passing `-Db_sanitize=address,...
+  # on the command line.
+  foreach sanitize: ['address', 'pointer-compare', 'pointer-subtract', 
'undefined']
+    add_global_arguments('-fsanitize=' + sanitize, language: 'cpp')
+    add_global_link_arguments('-fsanitize=' + sanitize, language: 'cpp')
+  endforeach
+endif
+
+executable('chkstat', [
+    'src/chkstat.cpp',
+    'src/cmdline.cpp',
+    'src/entryproc.cpp',
+    'src/formatting.cpp',
+    'src/profparser.cpp',
+    'src/utility.cpp',
+    'src/varexp.cpp'
+  ],
+  dependencies: [dependency('libcap'), dependency('tclap')],
+  # link statically against libstdc++. since some people are afraid of ABI
+  # changes in this area and since permissions is a base package in SUSE this
+  # protects us from such potential breakage at the expense of some increased
+  # binary size
+  link_args: ['-static-libstdc++'],
+  install: true
+)
+
+install_man('man/chkstat.8')
+install_man('man/permissions.5')
+install_data(sources: 'etc/sysconfig.security', install_dir: 
'share/fillup-templates')
+install_data(sources: 'zypper-plugin/permissions.py', install_dir: 
'lib/zypp/plugins/commit')
+install_data(sources: ['etc/variables.conf', 'etc/permissions', 
'profiles/permissions.easy', 'profiles/permissions.secure', 
'profiles/permissions.paranoid'], install_dir: 'share/permissions')
+install_data(sources: 'etc/permissions.local', install_dir: '/etc')
+install_subdir('permissions.d', install_dir: 'share/permissions')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/permissions-1699_20240305/meson_options.txt 
new/permissions-1699_20240307/meson_options.txt
--- old/permissions-1699_20240305/meson_options.txt     1970-01-01 
01:00:00.000000000 +0100
+++ new/permissions-1699_20240307/meson_options.txt     2024-03-07 
17:26:30.000000000 +0100
@@ -0,0 +1 @@
+option('testbuild', type: 'boolean', value: false, description: 'apply extra 
build settings for the regression test')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/permissions-1699_20240305/tests/base.py 
new/permissions-1699_20240307/tests/base.py
--- old/permissions-1699_20240305/tests/base.py 2024-03-05 15:37:29.000000000 
+0100
+++ new/permissions-1699_20240307/tests/base.py 2024-03-07 17:26:30.000000000 
+0100
@@ -124,7 +124,11 @@
 
         perm_root = os.path.realpath(__file__).split(os.path.sep)[:-2]
         self.m_permissions_repo = os.path.sep.join(perm_root)
-        self.m_chkstat_orig = os.path.sep.join([self.m_permissions_repo, 
"src/chkstat"])
+
+        if not self.m_args.buildtree.startswith(os.path.sep):
+            self.m_args.buildtree = os.path.sep.join([self.m_permissions_repo, 
self.m_args.buildtree])
+
+        self.m_chkstat_orig = os.path.sep.join([self.m_args.buildtree, 
"chkstat"])
 
     def printDebug(self, *args, **kwargs):
 
@@ -176,8 +180,11 @@
             help="Build a more debug friendly version of chkstat to make 
tracking down bugs in `gdb` easier"
         )
 
+        self.m_parser.add_argument('buildtree', default='build',
+           help="The meson build tree to use.", nargs='?')
+
         self.m_parser.add_argument(
-            "--skip-make", action='store_true',
+            "--skip-build", action='store_true',
             help="By default the regtest tries to (re)build the chkstat 
binary. If this switch is set then whichever binary is currently found will be 
used."
         )
 
@@ -604,7 +611,7 @@
 
     def buildChkstat(self):
 
-        if self.m_args.skip_make:
+        if self.m_args.skip_build:
             if not os.path.exists(self.m_chkstat_orig):
                 print("Couldn't find compiled chkstat binary in",
                       self.m_chkstat_orig, file=sys.stderr)
@@ -615,26 +622,29 @@
         self.printHeading("Rebuilding test version of chkstat")
         print()
 
-        subprocess.check_call(
-            ["make", "clean"],
-            cwd=self.m_permissions_repo
-        )
-
+        buildtype = "debug" if self.m_args.build_debug else "debugoptimized"
+        settings = []
         # this causes a debug version with additional libasan routines
         # to be built for testing
         # asan requires /proc so don't use it if we don't mount it
-        make_env = os.environ.copy()
         if not self.m_args.skip_proc:
-            make_env["CHKSTAT_TEST"] = "1"
-        if self.m_args.build_debug:
-            make_env["CHKSTAT_DEBUG"] = "1"
+            settings.append("-Dtestbuild=true")
 
         try:
-            subprocess.check_call(
-                ["make"],
-                cwd=self.m_permissions_repo,
-                env=make_env
-            )
+            meson_config_args = ["--buildtype", buildtype] + settings
+            if not os.path.exists(self.m_args.buildtree):
+                os.makedirs(self.m_args.buildtree)
+                subprocess.check_call(
+                    ["meson", "setup"] + meson_config_args + 
[self.m_args.buildtree],
+                    cwd=self.m_permissions_repo
+                )
+            else:
+                subprocess.check_call(
+                    ["meson", "configure"] + meson_config_args,
+                    cwd=self.m_args.buildtree,
+                )
+            print()
+            subprocess.check_call(["meson", "compile"], 
cwd=self.m_args.buildtree)
             print()
         except subprocess.CalledProcessError:
             color_printer.setRed()

Reply via email to