Browse Source

tested all rpm builds

master
Marc Wäckerlin 2 years ago
parent
commit
4a063cc022
10 changed files with 410 additions and 52 deletions
  1. 283
    1
      ax_init_standard_project.m4
  2. 24
    15
      bootstrap.sh
  3. 1
    0
      build-in-docker.conf
  4. 14
    12
      build-in-docker.sh
  5. 8
    2
      configure.ac
  6. 4
    4
      debian/control.in
  7. 25
    12
      mrw-c++.spec.in
  8. 11
    3
      resolve-debbuilddeps.sh
  9. 26
    3
      resolve-rpmbuilddeps.sh
  10. 14
    0
      rpmsign.exp

+ 283
- 1
ax_init_standard_project.m4 View File

@@ -570,7 +570,7 @@ AC_DEFUN([AX_USE_RPM_PACKAGING], [
570 570
 EXTRA_DIST += \${PACKAGE_NAME}.spec.in
571 571
 rpm: dist
572 572
 	rpmbuild -ba --define "_topdir \$\$(pwd)" --define "_sourcedir \$\$(pwd)" \${PACKAGE_NAME}.spec
573
-	rpmsign --define "_gpg_name \${PACKAGER}" --addsign RPMS/*/*.rpm SRPMS/*.rpm
573
+	./rpmsign.exp "\${PACKAGER}" "\{PASSWORD}" RPMS/*/*.rpm SRPMS/*.rpm
574 574
 clean-rpm-targets:
575 575
 	-rm -rf BUILD BUILDROOT RPMS SPECS SRPMS
576 576
 distclean-rpm-targets:
@@ -802,6 +802,120 @@ AC_DEFUN([AX_PKG_REQUIRE], [
802 802
       AC_MSG_ERROR([Feature $1 not found please install module $secondpar])
803 803
     fi
804 804
   fi
805
+  AX_DEB_DEPEND([${$1_found}])
806
+  AX_RPM_DEPEND([${$1_found}])
807
+  [$1]_CPPFLAGS="${$1_CFLAGS}"
808
+  [$1]_CXXFLAGS="${$1_CFLAGS}"
809
+  AC_SUBST([$1]_CPPFLAGS)
810
+  AC_SUBST([$1]_CXXFLAGS)
811
+  if test "${optional_flags/manualflags/}" = "${optional_flags}"; then
812
+    CPPFLAGS+=" ${$1_CPPFLAGS}"
813
+    CXXFLAGS+=" ${$1_CXXFLAGS}"
814
+    LIBS+=" ${$1_LIBS}"
815
+    AC_MSG_NOTICE([Adding flags for $1])
816
+  else
817
+    AC_MSG_NOTICE([To enable $1, add $1_CPPFLAGS, $1_CXXFLAGS and $1_LIBS])
818
+  fi
819
+])
820
+
821
+# require a specific development package, with fallback: test for a header
822
+#  - parameter:
823
+#     $1 = unique id (no special characters)
824
+#     $2 = module name (optional, if different from id)
825
+#     $3 = a header file to find (optional)
826
+#     $4 = alternative module names (space separated, optional)
827
+#     $5 = optional flags:
828
+#            manualflags if CXXFLAGS, CPPFLAGS, LIBS should remain unchanged
829
+#
830
+# uses PKG_CHECK_MODULES to test for a module
831
+# then, if given, looks for the header file
832
+# if header file is not found, searches in alternative modules
833
+# sets all flags, so that the module can be used everywhere
834
+# fails if not found
835
+AC_DEFUN([AX_PKG_REQUIRE_DEV], [
836
+  PKG_PROG_PKG_CONFIG
837
+  optional_flags="$5"
838
+  $1_found=no
839
+  secondpar="m4_default([$2], [$1])"
840
+  PKG_CHECK_MODULES([$1], [m4_default([$2], [$1])], [
841
+    $1_found=$secondpar
842
+    PKG_REQUIREMENTS+=" $secondpar"
843
+  ], [
844
+    if test -n "$4"; then
845
+      AC_MSG_WARN([Recommended package $secondpar for feature $1 not installed, trying $4])
846
+      for pkg in $4; do
847
+        PKG_CHECK_MODULES([$1], [$pkg], [
848
+          PKG_REQUIREMENTS+=" $pkg"
849
+          $1_found=$pkg
850
+          break;
851
+        ], [
852
+          AC_MSG_WARN([Recommended package $pkg for feature $1 not installed])
853
+        ])
854
+      done
855
+    fi
856
+  ])
857
+  AC_SUBST(CPPFLAGS)
858
+  AC_SUBST(CXXFLAGS)
859
+  AC_SUBST(PKG_REQUIREMENTS)
860
+  if test -n "$3"; then
861
+    if test "${$1_found}" = "no"; then
862
+      tmp_package="yes"
863
+    else
864
+      tmp_package=${$1_found}
865
+    fi
866
+    $1_found=no
867
+    old_CPPFLAGS=${CPPFLAGS}
868
+    CPPFLAGS=" ${$1_CFLAGS} ${CPPFLAGS}"
869
+    AC_CHECK_HEADER([$3], [
870
+      $1_found=${tmp_package}
871
+    ], [
872
+      for x in ${$1_CFLAGS}; do
873
+        AC_MSG_NOTICE([search for $3 in ${x[#]-I}])
874
+        for f in $(find ${x[#]-I} -name "$3" 2> /dev/null); do
875
+          if test -f "$f"; then
876
+            $1_found=${tmp_package}
877
+            $1_CFLAGS+=" -I${f%/*}"
878
+            AC_MSG_NOTICE([added path ${f%/*}])
879
+            break;
880
+          fi
881
+        done
882
+        if test "${$1_found}" != "no"; then
883
+          break;
884
+        fi
885
+      done
886
+      if test "${$1_found}" = "no"; then
887
+        tmp_includedir=$(${PKG_CONFIG} --variable=includedir $tmp_package)
888
+        for x in ${tmp_includedir}; do
889
+          AC_MSG_NOTICE([search for $3 in $x])
890
+          for f in $(find ${x} -name "$3" 2> /dev/null); do
891
+            if test -f "$f"; then
892
+              $1_found=${tmp_package}
893
+              $1_CFLAGS+=" -I${f%/*}"
894
+              AC_MSG_NOTICE([added path ${f%/*}])
895
+              break;
896
+            fi
897
+          done
898
+          if test "${$1_found}" != "no"; then
899
+            break;
900
+          fi
901
+        done
902
+      fi
903
+    ])
904
+    CPPFLAGS=${old_CPPFLAGS}
905
+  fi
906
+  if test "${$1_found}" = "no"; then
907
+    if test -n "$3"; then
908
+      if test -n "$4"; then
909
+        AC_MSG_ERROR([Feature $1 not found, need header $3 in modules $secondpar or $4])
910
+      else
911
+        AC_MSG_ERROR([Feature $1 not found, need header $3 in module $secondpar])
912
+      fi
913
+    else
914
+      AC_MSG_ERROR([Feature $1 not found please install module $secondpar])
915
+    fi
916
+  fi
917
+  AX_DEB_BUILD_DEPEND([${$1_found}-dev])
918
+  AX_RPM_BUILD_DEPEND([${$1_found}-devel])
805 919
   [$1]_CPPFLAGS="${$1_CFLAGS}"
806 920
   [$1]_CXXFLAGS="${$1_CFLAGS}"
807 921
   AC_SUBST([$1]_CPPFLAGS)
@@ -851,6 +965,52 @@ AC_DEFUN([AX_PKG_CHECK], [
851 965
   ], [
852 966
     HAVE_$1=0
853 967
   ])
968
+  AX_DEB_BUILD_DEPEND(m4_default([$2], [$1]))
969
+  AX_RPM_BUILD_DEPEND(m4_default([$2], [$1]))
970
+  AM_CONDITIONAL(HAVE_$1, test $HAVE_[$1] -eq 1)
971
+  AC_SUBST(HAVE_$1)
972
+  AC_SUBST(CPPFLAGS)
973
+  AC_SUBST(CXXFLAGS)
974
+  AC_SUBST(PKG_REQUIREMENTS)
975
+])
976
+
977
+# check if a specific development package exists
978
+#  - parameter:
979
+#     $1 = unique id (no special characters)
980
+#     $2 = module name (optional, if different from id)
981
+#     $3 = optional flags:
982
+#          manualflags if CXXFLAGS, CPPFLAGS, LIBS should remain unchanged
983
+#
984
+# uses PKG_CHECK_MODULES to test for a module
985
+# sets automake conditional HAVE_$1 to 0 (not found) or 1 (found)
986
+# sets all flags, so that the module can be used everywhere
987
+AC_DEFUN([AX_PKG_CHECK_DEV], [
988
+  optional_flags="$3"
989
+  PKG_PROG_PKG_CONFIG
990
+  PKG_CHECK_MODULES([$1], [m4_default([$2], [$1])], [
991
+    HAVE_$1=1
992
+    [$1]_CPPFLAGS="${$1_CFLAGS}"
993
+    [$1]_CXXFLAGS="${$1_CFLAGS}"
994
+    AC_SUBST([$1]_CPPFLAGS)
995
+    AC_SUBST([$1]_CXXFLAGS)
996
+    if test "${optional_flags/manualflags/}" = "${optional_flags}"; then
997
+      CPPFLAGS+=" ${$1_CPPFLAGS}"
998
+      CXXFLAGS+=" ${$1_CXXFLAGS}"
999
+      LIBS+=" ${$1_LIBS}"
1000
+      AC_MSG_NOTICE([Adding flags for $1])
1001
+    else
1002
+      AC_MSG_NOTICE([To enable $1, add $1_CPPFLAGS, $1_CXXFLAGS and $1_LIBS])
1003
+    fi
1004
+    if test -z "$PKG_REQUIREMENTS"; then
1005
+      PKG_REQUIREMENTS="m4_default([$2], [$1])"
1006
+    else
1007
+      PKG_REQUIREMENTS="${PKG_REQUIREMENTS}, m4_default([$2], [$1])"
1008
+    fi
1009
+  ], [
1010
+    HAVE_$1=0
1011
+  ])
1012
+  AX_DEB_BUILD_DEPEND(m4_default([$2], [$1])-dev)
1013
+  AX_RPM_BUILD_DEPEND(m4_default([$2], [$1])-devel)
854 1014
   AM_CONDITIONAL(HAVE_$1, test $HAVE_[$1] -eq 1)
855 1015
   AC_SUBST(HAVE_$1)
856 1016
   AC_SUBST(CPPFLAGS)
@@ -1018,3 +1178,125 @@ AC_DEFUN([AX_DEB_RESOLVE], [
1018 1178
   AC_SUBST(DEB_SECTION)
1019 1179
   AC_SUBST(DEB_DEPEND_IFEXISTS)
1020 1180
 ])
1181
+
1182
+# Check if a package exists in the current distribution, if yes, require it
1183
+# in .spec.in append @RPM_DEPEND_IFEXISTS@ to Build-Depends
1184
+#  - parameter:
1185
+#     $1 = package name
1186
+AC_DEFUN([AX_RPM_DEPEND_IFEXISTS], [
1187
+  pkg="$1"
1188
+  
1189
+  if (test -x /usr/bin/zypper && zypper search -x "$pkg" 1>&2 > /dev/null) || \
1190
+     (test -x /usr/bin/dnf && dnf list -q "$pkg" 1>&2 > /dev/null) || \
1191
+     (test -x /usr/bin/yum && yum list -q "$pkg" 1>&2 > /dev/null) || \
1192
+     (test -x /usr/sbin/urpmq && urpmq "$pkg" 1>&2 > /dev/null); then
1193
+       RPM_DEPEND_IFEXISTS="${RPM_DEPEND_IFEXISTS}, ${pkg}"
1194
+  fi
1195
+])
1196
+
1197
+# require package in .spec.in append @RPM_BUILD_DEPEND@ to Build-Depends
1198
+#  - parameter:
1199
+#     $1 = package name
1200
+AC_DEFUN([AX_RPM_BUILD_DEPEND], [
1201
+  pkg="$1"
1202
+  RPM_BUILD_DEPEND="${RPM_BUILD_DEPEND}, ${pkg}"
1203
+])
1204
+
1205
+# require package in .spec.in append @RPM_DEPEND@ to Depends
1206
+#  - parameter:
1207
+#     $1 = package name
1208
+AC_DEFUN([AX_RPM_DEPEND], [
1209
+  pkg="$1"
1210
+  if test -z "${RPM_DEPEND}"; then
1211
+    RPM_DEPEND="${pkg}"
1212
+  else
1213
+    RPM_DEPEND="${RPM_DEPEND}, ${pkg}"
1214
+  fi
1215
+])
1216
+
1217
+# require package in debian/control.in append @DEB_DEPEND@ to Depends
1218
+#  - parameter:
1219
+#     $1 = package name
1220
+AC_DEFUN([AX_RPM_GROUP], [
1221
+  pkg="$1"
1222
+  RPM_GROUP="${pkg}"
1223
+])
1224
+
1225
+# call after setting rpmian dependencies
1226
+AC_DEFUN([AX_RPM_RESOLVE], [
1227
+  AC_SUBST(RPM_BUILD_DEPEND)
1228
+  AC_SUBST(RPM_DEPEND)
1229
+  AC_SUBST(RPM_GROUP)
1230
+  AC_SUBST(RPM_DEPEND_IFEXISTS)
1231
+])
1232
+
1233
+# Check if a package exists in the current distribution, if yes, require it
1234
+# in .spec.in append @ALL_DEPEND_IFEXISTS@ to Build-Depends
1235
+#  - parameter:
1236
+#     $1 = package name
1237
+AC_DEFUN([AX_ALL_DEPEND_IFEXISTS], [
1238
+  pkg="$1"
1239
+  if test -n "$(apt-cache policy -q ${pkg} 2> /dev/null)"; then
1240
+     DEB_DEPEND_IFEXISTS="${DEB_DEPEND_IFEXISTS}, ${pkg}"
1241
+  fi
1242
+  if (test -x /usr/bin/zypper && zypper search -x "$pkg" 1>&2 > /dev/null) || \
1243
+     (test -x /usr/bin/dnf && dnf list -q "$pkg" 1>&2 > /dev/null) || \
1244
+     (test -x /usr/bin/yum && yum list -q "$pkg" 1>&2 > /dev/null) || \
1245
+     (test -x /usr/sbin/urpmq && urpmq "$pkg" 1>&2 > /dev/null); then
1246
+       RPM_DEPEND_IFEXISTS="${RPM_DEPEND_IFEXISTS}, ${pkg}"
1247
+  fi
1248
+])
1249
+
1250
+# Check if a package exists in the current distribution, if yes, require it
1251
+# in .spec.in append @ALL_DEPEND_IFEXISTS@ to Build-Depends
1252
+#  - parameter:
1253
+#     $1 = package name
1254
+AC_DEFUN([AX_ALL_DEPEND_IFEXISTS_DEV], [
1255
+  pkg="$1"
1256
+  if test -n "$(apt-cache policy -q ${pkg}-dev 2> /dev/null)"; then
1257
+     DEB_DEPEND_IFEXISTS="${DEB_DEPEND_IFEXISTS}, ${pkg}-dev"
1258
+  fi
1259
+  if (test -x /usr/bin/zypper && zypper search -x "$pkg"-devel 1>&2 > /dev/null) || \
1260
+     (test -x /usr/bin/dnf && dnf list -q "$pkg"-devel 1>&2 > /dev/null) || \
1261
+     (test -x /usr/bin/yum && yum list -q "$pkg"-devel 1>&2 > /dev/null) || \
1262
+     (test -x /usr/sbin/urpmq && urpmq "$pkg"-devel 1>&2 > /dev/null); then
1263
+       RPM_DEPEND_IFEXISTS="${RPM_DEPEND_IFEXISTS}, ${pkg}-devel"
1264
+  fi
1265
+])
1266
+
1267
+# require package in .spec.in append @ALL_BUILD_DEPEND@ to Build-Depends
1268
+#  - parameter:
1269
+#     $1 = package name
1270
+AC_DEFUN([AX_ALL_BUILD_DEPEND], [
1271
+  pkg="$1"
1272
+  DEB_BUILD_DEPEND="${DEB_BUILD_DEPEND}, ${pkg}"
1273
+  RPM_BUILD_DEPEND="${RPM_BUILD_DEPEND}, ${pkg}"
1274
+])
1275
+
1276
+# require package in .spec.in append @ALL_BUILD_DEPEND@ to Build-Depends
1277
+#  - parameter:
1278
+#     $1 = package name
1279
+AC_DEFUN([AX_ALL_BUILD_DEPEND_DEV], [
1280
+  pkg="$1"
1281
+  DEB_BUILD_DEPEND="${DEB_BUILD_DEPEND}, ${pkg}-dev"
1282
+  RPM_BUILD_DEPEND="${RPM_BUILD_DEPEND}, ${pkg}-devel"
1283
+])
1284
+
1285
+# require package in .spec.in append @ALL_DEPEND@ to Depends
1286
+#  - parameter:
1287
+#     $1 = package name
1288
+AC_DEFUN([AX_ALL_DEPEND], [
1289
+  pkg="$1"
1290
+  DEB_DEPEND="${DEB_DEPEND}, ${pkg}"
1291
+  if test -z "${RPM_DEPEND}"; then
1292
+    RPM_DEPEND="${pkg}"
1293
+  else
1294
+    RPM_DEPEND="${RPM_DEPEND}, ${pkg}"
1295
+  fi
1296
+])
1297
+
1298
+AC_DEFUN([AX_OUTPUT], [
1299
+  AX_DEB_RESOLVE
1300
+  AX_RPM_RESOLVE
1301
+  AC_OUTPUT
1302
+])

+ 24
- 15
bootstrap.sh View File

@@ -134,6 +134,7 @@ GENERATED FILES
134 134
     * resolve-rpmbuilddeps.sh - script to install RPM package dependencies
135 135
     * build-in-docker.sh - script to build the project encapsulated in a docker container
136 136
     * build-in-docker.conf - additional configuration for build-in-docker.sh
137
+    * rpmsign.exp - script for signing rpms unattended
137 138
     * build-resource-file.sh - build resource.qrc file from a resource directory
138 139
     * sql-to-dot.sed - script to convert SQL schema files to graphviz dot in doxygen
139 140
     * mac-create-app-bundle.sh - script to create apple mac os-x app-bundle
@@ -375,7 +376,7 @@ run() {
375 376
 
376 377
 testtag() {
377 378
     local IFS="|"
378
-    egrep -q '^ *'"($*)" configure.ac
379
+    egrep -q '^ *'"($*)"' *(\(.*)? *$' configure.ac
379 380
 }
380 381
 
381 382
 contains() {
@@ -539,6 +540,7 @@ copy makefile_test.inc.am
539 540
 copy resolve-debbuilddeps.sh
540 541
 copy resolve-rpmbuilddeps.sh
541 542
 copy build-in-docker.sh
543
+copy rpmsign.exp
542 544
 copy build-resource-file.sh
543 545
 copy sql-to-dot.sed
544 546
 copy mac-create-app-bundle.sh
@@ -592,7 +594,7 @@ AX_INIT_STANDARD_PROJECT
592 594
 #AX_QT_NO_KEYWORDS
593 595
 
594 596
 # create output
595
-AC_OUTPUT
597
+AX_OUTPUT
596 598
 EOF
597 599
 
598 600
 PACKAGE_NAME=$(sed -n 's/.*m4_define *( *x_package_name *, *\([^ ]*\) *).*/\1/p' configure.ac)
@@ -1552,7 +1554,7 @@ $(      if testtag AX_USE_LIBTOOL; then
1552 1554
 Package: @PACKAGE_NAME@-dev
1553 1555
 Section: libdevel
1554 1556
 Architecture: any
1555
-Depends: @PACKAGE_NAME@ (= \${binary:Version}), ${BUILD_DEPENDS}${RUN_DEPENDS} @DEB_DEPEND@ @DEB_BUILD_DEPEND@ @DEB_DEPEND_IFEXISTS@
1557
+Depends: @PACKAGE_NAME@ (= \${binary:Version}), ${BUILD_DEPENDS}${RUN_DEPENDS} @DEB_BUILD_DEPEND@ @DEB_DEPEND_IFEXISTS@
1556 1558
 Description: @DESCRIPTION@ - Development Package
1557 1559
 @README_DEB@
1558 1560
 EOF2
@@ -1600,11 +1602,12 @@ License: LGPL
1600 1602
 Group: $(if testtag AX_USE_LIBTOOL; then
1601 1603
   echo Development/Libraries/C++;
1602 1604
 else
1603
-  echo Applications/...;
1605
+  echo @RPM_GROUP@;
1604 1606
 fi)
1607
+$(if testtag AX_RPM_DEPEND; then echo "Requires: @RPM_DEPEND@"; fi)
1605 1608
 Source0: %{name}-%{version}.tar.gz
1606 1609
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
1607
-BuildRequires: gnupg, ${VCSDEPENDS_RPM} make, automake, autoconf, rpm-build$(
1610
+BuildRequires: gnupg, expect, ${VCSDEPENDS_RPM} make, automake, autoconf, rpm-build$(
1608 1611
     if testtag AX_USE_CXX; then
1609 1612
       echo -n ", binutils-devel, gcc-c++"
1610 1613
     fi
@@ -1617,7 +1620,7 @@ BuildRequires: gnupg, ${VCSDEPENDS_RPM} make, automake, autoconf, rpm-build$(
1617 1620
     if testtag AX_USE_PERLDOC; then
1618 1621
       echo -n ", libpod-tree-perl";
1619 1622
     fi
1620
-)
1623
+)  @RPM_BUILD_DEPEND@ @RPM_DEPEND_IFEXISTS@
1621 1624
 %if 0%{?fedora} != 20
1622 1625
 $(if testtag AX_USE_DOXYGEN; then echo -n "BuildRequires: graphviz"; fi)
1623 1626
 %endif
@@ -1690,12 +1693,14 @@ rm -rf \$RPM_BUILD_ROOT
1690 1693
 %files
1691 1694
 %defattr(-,root,root,-)
1692 1695
 $(if testtag AX_USE_LIBTOOL; then
1693
-echo '/usr/%_lib/@PACKAGE_NAME@.so.*'
1696
+echo '/usr/%_lib/*.so.*'
1694 1697
 else
1695 1698
 echo '/usr/bin/*'
1696 1699
 echo '/usr/share/applications/*'
1697 1700
 fi)
1698
-/usr/share/@PACKAGE_NAME@
1701
+$(if testtag AX_USE_NODEJS AX_BUILD_HTML AX_BUILD_HTML_NPM; then
1702
+echo '/usr/share/@PACKAGE_NAME@'
1703
+fi)
1699 1704
 %doc
1700 1705
 $(if testtag AX_USE_LIBTOOL; then
1701 1706
   cat <<EOF2
@@ -1707,7 +1712,7 @@ $(if testtag AX_USE_LIBTOOL; then
1707 1712
 /usr/share/doc/packages/@PACKAGE_NAME@/README
1708 1713
 EOF2
1709 1714
 else
1710
-  echo '/usr/share/doc/packages/@PACKAGE_NAME@'
1715
+  echo '/usr/share'
1711 1716
 fi)
1712 1717
 
1713 1718
 $(if testtag AX_USE_LIBTOOL; then
@@ -1715,7 +1720,7 @@ cat <<EOF2
1715 1720
 %package devel
1716 1721
 Summary: @DESCRIPTION@
1717 1722
 Group: Development/Libraries/C++
1718
-Requires: @PACKAGE_NAME@ = @VERSION@
1723
+Requires: @PACKAGE_NAME@ = @VERSION@ @RPM_BUILD_DEPEND@
1719 1724
 
1720 1725
 %description devel
1721 1726
 @README@
@@ -1724,14 +1729,18 @@ This Package contains all files required for developement.
1724 1729
 
1725 1730
 %files devel
1726 1731
 %defattr(-,root,root,-)
1727
-/usr/%_lib/@PACKAGE_NAME@.so
1728
-/usr/%_lib/@PACKAGE_NAME@.a
1729
-/usr/%_lib/@PACKAGE_NAME@.la
1732
+/usr/%_lib/*.so
1733
+/usr/%_lib/*.a
1734
+/usr/%_lib/*.la
1730 1735
 /usr/%_lib/pkgconfig
1731 1736
 /usr/include/*
1732 1737
 %doc
1733
-/usr/share/@PACKAGE_NAME@
1734
-/usr/share/doc/packages/@PACKAGE_NAME@/html
1738
+$(if testtag AX_USE_DOXYGEN AX_USE_PERLDOC; then
1739
+  echo '/usr/share/doc/packages/@PACKAGE_NAME@/html'
1740
+fi)
1741
+$(if testtag AX_BUILD_EXAMPLES; then
1742
+  echo '/usr/share/doc/packages/@PACKAGE_NAME@/examples'
1743
+fi)
1735 1744
 EOF2
1736 1745
 fi)
1737 1746
 

+ 1
- 0
build-in-docker.conf View File

@@ -1 +1,2 @@
1 1
 repos+=("Ubuntu:::universe")
2
+flags+=("CentOS:::--disable-stacktrace")

+ 14
- 12
build-in-docker.sh View File

@@ -90,6 +90,7 @@ while test $# -gt 0; do
90 90
                     img="ubuntu:latest"; host="${host:---host=i686-w64-mingw32}"
91 91
                     targets="all install"
92 92
                     flags+=("--prefix=/workdir/usr")
93
+                    packages1=("mingw-w64")
93 94
                     ;;
94 95
                 (*)
95 96
                     echo "**** ERROR: unknown mode '$1', try --help" 1>&2
@@ -235,7 +236,7 @@ if ! docker exec ${DOCKER_ID} getent passwd $(id -u) > /dev/null 2>&1; then
235 236
 fi
236 237
 docker exec ${DOCKER_ID} chown $(id -u):$(id -g) "${HOME}"
237 238
 case $mode in
238
-    (deb|apt)
239
+    (deb|apt|win)
239 240
         if [[ "${img}" =~ "ubuntu" ]]; then
240 241
             docker exec ${DOCKER_ID} locale-gen ${LANG}
241 242
             docker exec ${DOCKER_ID} update-locale LANG=${LANG}
@@ -281,7 +282,12 @@ gpgcheck=0
281 282
 EOF
282 283
         fi
283 284
         INSTALL_TOOL=$((docker exec ${DOCKER_ID} test -x /usr/bin/zypper && echo zypper install -y) ||  (docker exec ${DOCKER_ID} test -x /usr/bin/dnf && echo dnf install -y) || (docker exec ${DOCKER_ID} test -x /usr/bin/yum && echo yum install -y) || (docker exec ${DOCKER_ID} test -x /usr/sbin/urpmi && echo urpmi --auto))
284
-        docker exec ${DOCKER_ID} ${INSTALL_TOOL} rpm-build automake libtool subversion gcc-c++ pkgconfig wget /usr/bin/lsb_release
285
+        if test "$INSTALL_TOOL" = "urpmi --auto"; then
286
+            LSB_RELEASE=lsb-release
287
+        else
288
+            LSB-RELEASE=/usr/bin/lsb_release
289
+        fi
290
+        docker exec ${DOCKER_ID} ${INSTALL_TOOL} rpm-build automake libtool subversion gcc-c++ pkgconfig wget $LSB_RELEASE
285 291
         i=0
286 292
         for key in "${keys[@]}"; do
287 293
             wget -Orpm-key "$key"
@@ -295,14 +301,10 @@ EOF
295 301
         done
296 302
         docker exec ${DOCKER_ID} ./resolve-rpmbuilddeps.sh
297 303
         ;;
298
-    (win)
299
-        if [[ "${img}" =~ "ubuntu" ]]; then
300
-            docker exec ${DOCKER_ID} locale-gen ${LANG}
301
-            docker exec ${DOCKER_ID} update-locale LANG=${LANG}
302
-        fi
303
-        docker exec ${DOCKER_ID} apt-get update ${OPTIONS}
304
-        docker exec ${DOCKER_ID} apt-get install -y mingw-w64
305
-        docker exec ${DOCKER_ID} ./resolve-debbuilddeps.sh
306
-        ;;
307 304
 esac
308
-docker exec -u $(id -u):$(id -g) ${DOCKER_ID} ./bootstrap.sh -t "${targets}" ${host} ${flags[@]}
305
+FLAGS=()
306
+for f in "${flags[@]}"; do
307
+    FLAGS+=($(ifthenelse "$f" "echo 'ARG'"))
308
+done
309
+          
310
+docker exec -u $(id -u):$(id -g) ${DOCKER_ID} ./bootstrap.sh -t "${targets}" ${host} "${FLAGS[@]}"

+ 8
- 2
configure.ac View File

@@ -167,14 +167,20 @@ AC_SUBST(BOOST_THREAD_LIB)
167 167
 AM_CONDITIONAL(HAVE_BOOST_THREAD, test -n "$BOOST_THREAD_LIB")
168 168
 
169 169
 # special dependencies for specific distros
170
-AX_DEB_DEPEND_IFEXISTS(libiberty-dev)
170
+AX_ALL_BUILD_DEPEND_DEV(binutils)
171
+AX_ALL_DEPEND_IFEXISTS_DEV(libiberty)
172
+AX_DEB_BUILD_DEPEND(libboost-dev)
173
+AX_DEB_BUILD_DEPEND(liblog4cxx-dev)
174
+AX_DEB_BUILD_DEPEND(libz-dev)
175
+AX_RPM_BUILD_DEPEND(boost-devel)
176
+AX_RPM_BUILD_DEPEND(zlib-devel)
171 177
 
172 178
 # thread options
173 179
 THREADS="-pthread -D_MT"
174 180
 AC_SUBST(THREADS)
175 181
 
176 182
 # create output
177
-AC_OUTPUT
183
+AX_OUTPUT
178 184
 
179 185
 # infos and warnings
180 186
 if test "$with_threads" = "no"; then

+ 4
- 4
debian/control.in View File

@@ -1,18 +1,18 @@
1 1
 Source: @PACKAGE_NAME@
2 2
 Priority: extra
3
-Maintainer: @AUTHOR@
4
-Build-Depends: debhelper, fakeroot, svn2cl, subversion, subversion-tools, pkg-config, automake, libtool, autotools-dev, lsb-release , doxygen, graphviz, mscgen, default-jre-headless|default-jre, libcppunit-dev, libz-dev, binutils-dev, liblog4cxx-dev|liblog4cxx10-dev, libboost-thread-dev, pandoc @DEB_DEPEND_IFEXISTS@
3
+Maintainer: @PACKAGER@
4
+Build-Depends: debhelper, fakeroot, svn2cl, subversion, subversion-tools, pkg-config, automake, libtool, autotools-dev, pandoc, lsb-release, doxygen, graphviz, mscgen, default-jre-headless|default-jre, libcppunit-dev @DEB_BUILD_DEPEND@ @DEB_DEPEND_IFEXISTS@
5 5
 
6 6
 Package: @PACKAGE_NAME@
7 7
 Section: libs
8 8
 Architecture: any
9
-Depends: ${shlibs:Depends}, ${misc:Depends}
9
+Depends: ${shlibs:Depends}, ${misc:Depends} @DEB_DEPEND@
10 10
 Description: @DESCRIPTION@
11 11
 @README_DEB@
12 12
 
13 13
 Package: @PACKAGE_NAME@-dev
14 14
 Section: libdevel
15 15
 Architecture: any
16
-Depends: @PACKAGE_NAME@ (= ${binary:Version}), debhelper, subversion, pkg-config, automake, libtool, autotools-dev, pandoc, lsb-release , doxygen, graphviz, mscgen, libcppunit-dev
16
+Depends: @PACKAGE_NAME@ (= ${binary:Version}), debhelper, fakeroot, svn2cl, subversion, subversion-tools, pkg-config, automake, libtool, autotools-dev, pandoc, lsb-release, doxygen, graphviz, mscgen, default-jre-headless|default-jre, libcppunit-dev @DEB_BUILD_DEPEND@ @DEB_DEPEND_IFEXISTS@
17 17
 Description: @DESCRIPTION@ - Development Package
18 18
 @README_DEB@

+ 25
- 12
mrw-c++.spec.in View File

@@ -4,27 +4,36 @@ Version: @VERSION@
4 4
 Release: @BUILD_NUMBER@%{?dist}
5 5
 License: LGPL
6 6
 Group: Development/Libraries/C++
7
+
7 8
 Source0: %{name}-%{version}.tar.gz
8
-BuildRequires: rpm-build, subversion, automake, autoconf, doxygen, java-openjdk, libtool, binutils-devel, gcc-c++
9
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
10
+BuildRequires: gnupg, expect, subversion, make, automake, autoconf, rpm-build, binutils-devel, gcc-c++, libtool, doxygen, java-openjdk  @RPM_BUILD_DEPEND@ @RPM_DEPEND_IFEXISTS@
9 11
 %if 0%{?fedora} != 20
10 12
 BuildRequires: graphviz
11 13
 %endif
12
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
13 14
 %if 0%{?fedora} || 0%{?rhel} || 0%{?rhl} || 0%{?centos} || 0%{?centos_ver} || 0%{?centos_version} || 0%{?mageia}
14 15
 BuildRequires: which, pkgconfig, cppunit-devel
15 16
 %if 0%{?rhel} > 6 || 0%{?rhl} > 6 || 0%{?centos} > 6 || 0%{?fedora} || 0%{?mageia}
16 17
 BuildRequires: rpm-sign
17 18
 %endif
18 19
 %if 0%{?mageia}
19
-BuildRequires: lsb-release, gnupg, libltdl-devel
20
+BuildRequires: gnupg, lsb-release, libltdl-devel
20 21
 %else
21
-BuildRequires: redhat-lsb, gpg, libtool-ltdl-devel
22
+BuildRequires: gpg, redhat-lsb, libtool-ltdl-devel
22 23
 %endif
23 24
 %if ! ( 0%{?centos} || 0%{?centos_ver} || 0%{?centos_version} )
24 25
 BuildRequires: mscgen
26
+
27
+%else
28
+
25 29
 %endif
26 30
 %else%if 0%{?suse_version} || 0%{?sles_version}
27
-BuildRequires: pkg-config, libcppunit-devel, lsb-release
31
+BuildRequires: pkg-config, lsb-release, libcppunit-devel
32
+%if 0%{?suse_version} < 1200 ||  0%{?sles_version} < 1200
33
+
34
+%else
35
+
36
+%endif
28 37
 %endif%endif
29 38
 
30 39
 %description
@@ -35,7 +44,10 @@ This package contains only the shared libraries required at runtime.
35 44
 
36 45
 %prep
37 46
 %setup -q
38
-./configure --prefix=/usr --docdir=/usr/share/doc/packages/@PACKAGE_NAME@ --libdir=/usr/%_lib
47
+./configure --prefix=/usr \
48
+            --sysconfdir=/etc \
49
+            --docdir=/usr/share/doc/packages/@PACKAGE_NAME@ \
50
+            --libdir=/usr/%_lib
39 51
 
40 52
 %build
41 53
 make
@@ -48,7 +60,8 @@ rm -rf $RPM_BUILD_ROOT
48 60
 
49 61
 %files
50 62
 %defattr(-,root,root,-)
51
-/usr/%_lib/lib*.so.*
63
+/usr/%_lib/*.so.*
64
+
52 65
 %doc
53 66
 /usr/share/doc/packages/@PACKAGE_NAME@/AUTHORS
54 67
 /usr/share/doc/packages/@PACKAGE_NAME@/COPYING
@@ -60,7 +73,7 @@ rm -rf $RPM_BUILD_ROOT
60 73
 %package devel
61 74
 Summary: @DESCRIPTION@
62 75
 Group: Development/Libraries/C++
63
-Requires: @PACKAGE_NAME@ = @VERSION@
76
+Requires: @PACKAGE_NAME@ = @VERSION@ @RPM_BUILD_DEPEND@
64 77
 
65 78
 %description devel
66 79
 @README@
@@ -69,11 +82,11 @@ This Package contains all files required for developement.
69 82
 
70 83
 %files devel
71 84
 %defattr(-,root,root,-)
72
-/usr/%_lib/lib*.so
73
-/usr/%_lib/lib*.a
74
-/usr/%_lib/lib*.la
85
+/usr/%_lib/*.so
86
+/usr/%_lib/*.a
87
+/usr/%_lib/*.la
75 88
 /usr/%_lib/pkgconfig
76
-/usr/include/
89
+/usr/include/*
77 90
 %doc
78 91
 /usr/share/doc/packages/@PACKAGE_NAME@/html
79 92
 /usr/share/doc/packages/@PACKAGE_NAME@/examples

+ 11
- 3
resolve-debbuilddeps.sh View File

@@ -35,16 +35,24 @@ TO_INSTALL=
35 35
 DEPS=
36 36
 
37 37
 if test -e debian/control.in -a ! -e debian/control; then
38
-    for f in $(sed -n 's, *AX_DEB_DEPEND_IFEXISTS(\([^)]*\)).*,\1,p' configure.ac); do
38
+    for f in $(sed -n 's, *AX_\(DEB\|ALL\)_DEPEND_IFEXISTS(\([^)]*\)).*,\2,p' configure.ac); do
39 39
         if test -n "$(${DO} apt-cache policy -q ${f})" && ((! $(${DO} apt-cache policy ${f} 2>&1 | grep -q 'N: Unable to locate package')) && (! ${DO} dpkg -l "${f}")); then
40 40
             DEPS+=" ${f}"
41 41
         fi
42 42
     done
43
-    for f in $(sed -n 's, *AX_DEB_BUILD_DEPEND(\([^)]*\)).*,\1,p' configure.ac); do
43
+    for f in $(sed -n 's, *AX_\(DEB\|ALL\)_DEPEND_IFEXISTS_DEV(\([^)]*\)).*,\2,p' configure.ac); do
44
+        if test -n "$(${DO} apt-cache policy -q ${f}-dev)" && ((! $(${DO} apt-cache policy ${f}-dev 2>&1 | grep -q 'N: Unable to locate package')) && (! ${DO} dpkg -l "${f}-dev")); then
45
+            DEPS+=" ${f}-dev"
46
+        fi
47
+    done
48
+    for f in $(sed -n 's, *AX_\(DEB\|ALL\)\(_BUILD\)\?_DEPEND(\([^)]*\)).*,\3,p' configure.ac); do
44 49
         DEPS+=" ${f}"
45 50
     done
51
+    for f in $(sed -n 's, *AX_\(DEB\|ALL\)\(_BUILD\)\?_DEPEND_DEV(\([^)]*\)).*,\3,p' configure.ac); do
52
+        DEPS+=" ${f}-dev"
53
+    done
46 54
     trap "rm debian/control" INT TERM EXIT
47
-    sed 's,@\(DEB_DEPEND_IFEXISTS\|DEB_BUILD_DEPEND\|DEB_DEPEND\)@,,g' debian/control.in | \
55
+    sed 's,@\(\(ALL\|DEB\)_DEPEND_IFEXISTS\|\(ALL\|DEB\)_BUILD_DEPEND\|\(ALL\|DEB\)_DEPEND\)@,,g' debian/control.in | \
48 56
         sed 's,@[^@]*@, dummytext,g' > debian/control
49 57
 fi
50 58
 

+ 26
- 3
resolve-rpmbuilddeps.sh View File

@@ -15,10 +15,33 @@ SCHROOTNAME="$1"
15 15
 PACKAGE_NAME=$(sed -n 's/^ *m4_define(x_package_name, \(.*\)).*/\1/p' configure.ac)
16 16
 
17 17
 TRAP_CMD=
18
+DEPS=
18 19
 if test -e ${PACKAGE_NAME}.spec.in -a ! -e ${PACKAGE_NAME}.spec; then
20
+    for f in $(sed -n 's, *AX_\(RPM\|ALL\)_DEPEND_IFEXISTS(\([^)]*\)).*,\2,p' configure.ac); do
21
+        if (test -x /usr/bin/zypper && zypper search -x "$f" 1>&2 > /dev/null) || \
22
+               (test -x /usr/bin/dnf && dnf list -q "$f" 1>&2 > /dev/null) || \
23
+               (test -x /usr/bin/yum && yum list -q "$f" 1>&2 > /dev/null) || \
24
+               (test -x /usr/sbin/urpmq && urpmq "$f" 1>&2 > /dev/null); then
25
+            DEPS+=" ${f}"
26
+        fi
27
+    done
28
+    for f in $(sed -n 's, *AX_\(RPM\|ALL\)_DEPEND_IFEXISTS_DEV(\([^)]*\)).*,\2,p' configure.ac); do
29
+        if (test -x /usr/bin/zypper && zypper search -x "$f"-devel 1>&2 > /dev/null) || \
30
+               (test -x /usr/bin/dnf && dnf list -q "$f"-devel 1>&2 > /dev/null) || \
31
+               (test -x /usr/bin/yum && yum list -q "$f"-devel 1>&2 > /dev/null) || \
32
+               (test -x /usr/sbin/urpmq && urpmq "$f"-devel 1>&2 > /dev/null); then
33
+            DEPS+=" ${f}-devel"
34
+        fi
35
+    done
36
+    for f in $(sed -n 's, *AX_\(RPM\|ALL\)\(_BUILD\)\?_DEPEND(\([^)]*\)).*,\3,p' configure.ac); do
37
+        DEPS+=" ${f}"
38
+    done
39
+    for f in $(sed -n 's, *AX_\(RPM\|ALL\)\(_BUILD\)\?_DEPEND_DEV(\([^)]*\)).*,\3,p' configure.ac); do
40
+        DEPS+=" ${f}-devel"
41
+    done
19 42
     TRAP_CMD+="rm ${PACKAGE_NAME}.spec;"
20 43
     trap "${TRAP_CMD}" INT TERM EXIT
21
-    sed 's,@RPM_DEPEND_IFEXISTS@,,g' ${PACKAGE_NAME}.spec.in | \
44
+    sed 's,@\(\(ALL\|RPM\)_DEPEND_IFEXISTS\|\(ALL\|RPM\)_BUILD_DEPEND\|\(ALL\|RPM\)_DEPEND\)@,,g' ${PACKAGE_NAME}.spec.in | \
22 45
         sed 's,@[^@]*@, dummytext,g' > ${PACKAGE_NAME}.spec
23 46
 fi
24 47
 
@@ -32,12 +55,12 @@ fi
32 55
 if test -n "${SCHROOTNAME}"; then
33 56
     FILES=$(LANG= schroot -c ${SCHROOTNAME} -- rpmbuild -bb --clean --nobuild --define "_topdir ." --define "_sourcedir ." ${PACKAGE_NAME}.spec  2>&1 | sed -n 's, is needed by.*,,p')
34 57
     if test -n "${FILES}"; then
35
-        schroot -c ${SCHROOTNAME} -u root -- ${INSTALL_TOOL}  ${FILES}
58
+        schroot -c ${SCHROOTNAME} -u root -- ${INSTALL_TOOL}  ${FILES} ${DEPS}
36 59
     fi
37 60
 else
38 61
     FILES=$(LANG= rpmbuild -bb --clean --nobuild --define "_topdir ." --define "_sourcedir ." ${PACKAGE_NAME}.spec 2>&1 | sed -n 's, is needed by.*,,p')
39 62
     if test -n "${FILES}"; then
40
-        ${INSTALL_TOOL} ${FILES}
63
+        ${INSTALL_TOOL} ${FILES} ${DEPS}
41 64
     fi
42 65
 fi
43 66
 

+ 14
- 0
rpmsign.exp View File

@@ -0,0 +1,14 @@
1
+#!/usr/bin/expect -f
2
+
3
+set key [lindex $argv 0]
4
+set password [lindex $argv 1]
5
+set files [lrange $argv 2 end]
6
+
7
+### rpm-sign.exp -- Sign RPMs by sending the passphrase.
8
+spawn rpmsign --define "_gpg_name $key" --addsign {*}$files
9
+expect {
10
+    "Enter pass phrase: " {
11
+        send -- "$password\r"
12
+        exp_continue
13
+    } eof
14
+}

Loading…
Cancel
Save