Browse Source

new feature resolve-rpmbuilddeps.sh

master
Marc Wäckerlin 3 years ago
parent
commit
54a130697c
6 changed files with 255 additions and 43 deletions
  1. 8
    22
      ax_check_qt.m4
  2. 100
    7
      ax_init_standard_project.m4
  3. 38
    14
      bootstrap.sh
  4. 31
    0
      build-resource-file.sh
  5. 44
    0
      resolve-debbuilddeps.sh
  6. 34
    0
      resolve-rpmbuilddeps.sh

+ 8
- 22
ax_check_qt.m4 View File

@@ -38,6 +38,7 @@
38 38
 
39 39
 
40 40
 AC_DEFUN([AX_CXX_QT_TOOL], [
41
+  PKG_PROG_PKG_CONFIG
41 42
   if test -z "$HAVE_$1"; then
42 43
     HAVE_$1=1
43 44
     AC_MSG_CHECKING([for $2])
@@ -61,7 +62,7 @@ AC_DEFUN([AX_CXX_QT_TOOL], [
61 62
       fi
62 63
     fi
63 64
     AC_SUBST($1)
64
-    AM_CONDITIONAL(HAVE_$1, test $HAVE_$1 -eq 1)
65
+    AM_CONDITIONAL(HAVE_$1, test $HAVE_[$1] -eq 1)
65 66
     if test $HAVE_$1 -eq 1; then
66 67
       AC_MSG_RESULT([$$1])
67 68
     else
@@ -79,24 +80,6 @@ AC_DEFUN([AX_CXX_QT_TOOLS], [
79 80
   AX_CXX_QT_TOOL(LRELEASE, lrelease)
80 81
 ])
81 82
 
82
-AC_DEFUN([AX_CHECK_VALID_FLAG], [
83
-  AC_MSG_CHECKING([m4_default([$2], [for valid flag in "$1"])])
84
-  save_cppflags="$CPPFLAGS"
85
-  newflag="no"
86
-  for test_flag in $1; do
87
-    CPPFLAGS+=" ${test_flag}"
88
-    AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
89
-      newflag="$test_flag"
90
-      CPPFLAGS="$save_cppflags"
91
-      CPPFLAGS+=" ${test_flag}"
92
-      break;
93
-    ])
94
-    CPPFLAGS="$save_cppflags"
95
-  done
96
-  AC_SUBST(CPPFLAGS)
97
-  AC_MSG_RESULT([$newflag])
98
-])
99
-
100 83
 AC_DEFUN([AX_CHECK_QT], [
101 84
   qt_modules="$2"
102 85
   qt_modules_optional="$3"
@@ -148,8 +131,11 @@ AC_DEFUN([AX_CHECK_QT], [
148 131
       fi
149 132
     ], [HAVE_$1=0])
150 133
   ])
151
-  AM_CONDITIONAL(HAVE_$1, test $HAVE_$1 -eq 1)
152
-  AX_CHECK_VALID_FLAG([-fPIC -fPIE], [position independent code flag])
134
+  AM_CONDITIONAL(HAVE_$1, test $HAVE_[$1] -eq 1)
135
+  AX_CHECK_VALID_CXX_FLAG([-fPIC -fPIE], [position independent code flag])
136
+  if test "${MINGW}" != "no"; then
137
+    AX_CHECK_VALID_CXX_FLAG([-Wl,-subsystem,windows], [windows console flag])
138
+  fi
153 139
   AC_SUBST(QTDIR)
154 140
   AC_SUBST(QT_PLUGIN_PATH)
155 141
   AC_SUBST(CPPFLAGS)
@@ -176,7 +162,7 @@ qrc_%.cxx: %.qrc
176 162
 %.qm: %.ts
177 163
 	${LRELEASE} $< -qm [$][@]
178 164
 
179
-#%.ts: ${LANGUAGE_FILES}
165
+#%.ts: ${LANGUAGE_FILES:%=%}
180 166
 #	${LUPDATE} -no-obsolete \
181 167
 #	           -target-language ${@:${LANGUAGE_FILE_BASE}_%.ts=%} \
182 168
 #	           -ts [$][@] $<

+ 100
- 7
ax_init_standard_project.m4 View File

@@ -160,9 +160,10 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [
160 160
   AX_ADD_MAKEFILE_TARGET_DEP([clean-am], [clean-standard-project-targets], [makefile.in])
161 161
   AX_ADD_MAKEFILE_TARGET_DEP([distclean-am], [distclean-standard-project-targets], [makefile.in])
162 162
   AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-standard-project-targets], [makefile.in])
163
+  test -f makefile.in && sed -i '1iEXTRA_DIST = ' makefile.in
163 164
   test -f makefile.in && cat >> makefile.in <<EOF
164 165
 #### Begin: Appended by $0
165
-EXTRA_DIST = bootstrap.sh
166
+EXTRA_DIST += bootstrap.sh
166 167
 clean-standard-project-targets:
167 168
 	-rm -rf \${PACKAGE_NAME}-\${PACKAGE_VERSION}
168 169
 	-rm \${PACKAGE_TARNAME}-\${PACKAGE_VERSION}.tar.gz
@@ -250,10 +251,10 @@ EOF
250 251
 # use this in configure.ac to support HTML data for webservers
251 252
 AC_DEFUN([AX_BUILD_HTML], [
252 253
   AC_CONFIG_FILES([html/makefile])
253
-  AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-example-targets], [html/makefile.in])
254
-  test -f html/makefile.in && cat >> examples/html.in <<EOF
254
+  AX_ADD_MAKEFILE_TARGET_DEP([maintainer-clean-am], [maintainer-clean-html-targets], [html/makefile.in])
255
+  test -f html/makefile.in && cat >> html/makefile.in <<EOF
255 256
 #### Begin: Appended by $0
256
-maintainer-clean-example-targets:
257
+maintainer-clean-html-targets:
257 258
 	-rm makefile.in
258 259
 #### End: $0
259 260
 EOF
@@ -430,7 +431,7 @@ AC_DEFUN([AX_PKG_REQUIRE], [
430 431
     ], [
431 432
       for x in ${$1_CFLAGS}; do
432 433
         AC_MSG_NOTICE([search for $3 in ${x[#]-I}])
433
-        for f in $(find ${x[#]-I} -name "$3"); do
434
+        for f in $(find ${x[#]-I} -name "$3" 2> /dev/null); do
434 435
           if test -f "$f"; then
435 436
             $1_found=${tmp_package}
436 437
             $1_CFLAGS+=" -I${f%/*}"
@@ -446,7 +447,7 @@ AC_DEFUN([AX_PKG_REQUIRE], [
446 447
         tmp_includedir=$(${PKG_CONFIG} --variable=includedir $tmp_package)
447 448
         for x in ${tmp_includedir}; do
448 449
           AC_MSG_NOTICE([search for $3 in $x])
449
-          for f in $(find ${x} -name "$3"); do
450
+          for f in $(find ${x} -name "$3" 2> /dev/null); do
450 451
             if test -f "$f"; then
451 452
               $1_found=${tmp_package}
452 453
               $1_CFLAGS+=" -I${f%/*}"
@@ -501,7 +502,7 @@ AC_DEFUN([AX_PKG_CHECK], [
501 502
   ], [
502 503
     HAVE_$1=0
503 504
   ])
504
-  AM_CONDITIONAL(HAVE_$1, test $HAVE_$1 -eq 1)
505
+  AM_CONDITIONAL(HAVE_$1, test $HAVE_[$1] -eq 1)
505 506
   AC_SUBST(HAVE_$1)
506 507
   AC_SUBST(CPPFLAGS)
507 508
   AC_SUBST(CXXFLAGS)
@@ -532,3 +533,95 @@ AC_DEFUN([AX_REQUIRE_HEADER], [
532 533
     ], [])
533 534
   ], [])
534 535
 ])
536
+
537
+# Check within a list of CPP-Flags for the first that is usable and
538
+# configure it
539
+#  - parameter:
540
+#     $1 = white-space separated list of alternative flags
541
+#     $2 = module name (optional, if different from id)
542
+AC_DEFUN([AX_CHECK_VALID_CPP_FLAG], [
543
+  AC_MSG_CHECKING([m4_default([$2], [for valid flag in "$1"])])
544
+  save_cppflags="$CPPFLAGS"
545
+  newflag="no"
546
+  for test_flag in $1; do
547
+    CPPFLAGS+=" ${test_flag}"
548
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
549
+      newflag="$test_flag"
550
+      CPPFLAGS="$save_cppflags"
551
+      CPPFLAGS+=" ${test_flag}"
552
+      break;
553
+    ])
554
+    CPPFLAGS="$save_cppflags"
555
+  done
556
+  AC_SUBST(CPPFLAGS)
557
+  AC_MSG_RESULT([$newflag in $CPPFLAGS])
558
+])
559
+
560
+# Check within a list of CXX-Flags for the first that is usable and
561
+# configure it
562
+#  - parameter:
563
+#     $1 = white-space separated list of alternative flags
564
+#     $2 = module name (optional, if different from id)
565
+AC_DEFUN([AX_CHECK_VALID_CXX_FLAG], [
566
+  AC_MSG_CHECKING([m4_default([$2], [for valid flag in "$1"])])
567
+  save_cxxflags="$CXXFLAGS"
568
+  newflag="no"
569
+  for test_flag in $1; do
570
+    CXXFLAGS+=" ${test_flag}"
571
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
572
+      newflag="$test_flag"
573
+      CXXFLAGS="$save_cxxflags"
574
+      CXXFLAGS+=" ${test_flag}"
575
+      break;
576
+    ])
577
+    CXXFLAGS="$save_cxxflags"
578
+  done
579
+  AC_SUBST(CXXFLAGS)
580
+  AC_MSG_RESULT([$newflag in $CXXFLAGS])
581
+])
582
+
583
+# Check within a list of C-Flags for the first that is usable and
584
+# configure it
585
+#  - parameter:
586
+#     $1 = white-space separated list of alternative flags
587
+#     $2 = module name (optional, if different from id)
588
+AC_DEFUN([AX_CHECK_VALID_C_FLAG], [
589
+  AC_MSG_CHECKING([m4_default([$2], [for valid flag in "$1"])])
590
+  save_cflags="$CFLAGS"
591
+  newflag="no"
592
+  for test_flag in $1; do
593
+    CFLAGS+=" ${test_flag}"
594
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
595
+      newflag="$test_flag"
596
+      CFLAGS="$save_cflags"
597
+      CFLAGS+=" ${test_flag}"
598
+      break;
599
+    ])
600
+    CFLAGS="$save_cflags"
601
+  done
602
+  AC_SUBST(CFLAGS)
603
+  AC_MSG_RESULT([$newflag in $CFLAGS])
604
+])
605
+
606
+# Check within a list of LD-Flags for the first that is usable and
607
+# configure it
608
+#  - parameter:
609
+#     $1 = white-space separated list of alternative flags
610
+#     $2 = module name (optional, if different from id)
611
+AC_DEFUN([AX_CHECK_VALID_LD_FLAG], [
612
+  AC_MSG_CHECKING([m4_default([$2], [for valid flag in "$1"])])
613
+  save_ldflags="$LDFLAGS"
614
+  newflag="no"
615
+  for test_flag in $1; do
616
+    LDFLAGS+=" ${test_flag}"
617
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
618
+      newflag="$test_flag"
619
+      LDFLAGS="$save_ldflags"
620
+      LDFLAGS+=" ${test_flag}"
621
+      break;
622
+    ])
623
+    LDFLAGS="$save_ldflags"
624
+  done
625
+  AC_SUBST(LDFLAGS)
626
+  AC_MSG_RESULT([$newflag in $LDFLAGS])
627
+])

+ 38
- 14
bootstrap.sh View File

@@ -43,7 +43,7 @@ OPTIONS
43 43
 
44 44
   --configure, -c            call ./configure after initialization
45 45
   --build, -b                build, also call ./configure && make distcheck
46
-  --target, -t target        build target , also call ./configure && make target
46
+  --target, -t <target>      same as -b, but specify target instead of distcheck
47 47
   --overwrite, -o            overwrite all basic files (bootstrap.sh, m4-macros)
48 48
   --rebuild, -r              force rebuild of generated files, even if modified
49 49
   --rebuild-file, -f <file>  rebild specific file (can be added multiple times)
@@ -103,8 +103,13 @@ GENERATED FILES
103 103
     * ax_init_standard_project.m4 - auxiliary macro definition file
104 104
     * ax_cxx_compile_stdcxx_11.m4 - auxiliary macro definition file
105 105
     * ax_check_qt.m4 - auxiliary macro definition file
106
+    * resolve-debbuilddeps.sh - script to install debian package dependencies
107
+    * resolve-rpmbuilddeps.sh - script to install RPM package dependencies
108
+    * build-resource-file.sh - build resource.qrc file from a resource directory
106 109
     * mac-create-app-bundle.sh - script to create apple mac os-x app-bundle
107 110
     * AUTHORS - replace your name in AUTHORS before first run
111
+    * NEWS - empty file add your project's news
112
+    * README - add project description (first line is header, followed by an empty line)
108 113
     * configure.ac - global configuration file template
109 114
     * makefile.am - global makefile template
110 115
     * src/makefile.am - if you enabled AX_USE_CXX
@@ -149,6 +154,7 @@ FILES TO EDIT
149 154
 
150 155
   The following files normally require editing:
151 156
     * AUTHORS
157
+    * NEWS
152 158
     * README
153 159
     * configure.ac
154 160
     * src/makefile.am
@@ -165,19 +171,20 @@ FILE DEPENDENCIES
165 171
     * html/makefile.am depends on AX_BUILD_HTML
166 172
     * doc/doxyfile.in depends on AX_BUILD_EXAMPLES
167 173
     * debian/control.in depends on AX_USE_DOXYGEN, AX_USE_CPPUNIT,
168
-      AX_CXX_QT, AX_CXX_CHECK_QT, AX_USE_LIBTOOL
174
+      AX_CXX_QT, AX_CHECK_QT, AX_REQUIRE_QT, AX_USE_LIBTOOL
169 175
     * debian/${DEFAULT_PROJECT_NAME}.install depends on AX_USE_LIBTOOL
170 176
     * debian/${DEFAULT_PROJECT_NAME}.dirs depends on AX_USE_LIBTOOL
171 177
     * debian/${DEFAULT_PROJECT_NAME}-dev.install depends on AX_USE_LIBTOOL
172 178
     * debian/${DEFAULT_PROJECT_NAME}-dev.dirs depends on AX_USE_LIBTOOL
173
-    * ${DEFAULT_PROJECT_NAME}.spec.in dependson AX_USE_RPM_PACKAGING,
174
-      AX_USE_LIBTOOL, AX_CXX_CHECK_QT, AX_CXX_QT, AX_USE_CPPUNIT
179
+    * ${DEFAULT_PROJECT_NAME}.spec.in depends on AX_USE_RPM_PACKAGING,
180
+      AX_USE_LIBTOOL, AX_CHECK_QT, AX_REQUIRE_QT, AX_CXX_QT, AX_USE_CPPUNIT
175 181
 
176 182
 FILES
177 183
 
178 184
   * AUTHORS:      First line is the main author and used in Debian and RPM
179 185
                   packaging, so there must be a GPG key that matches
180 186
                   to this line.
187
+  * NEWS:         File to add project news.
181 188
   * README:       First line is a short description of your project, then an
182 189
                   empty line must follow. All remaining lines are a
183 190
                   long description of your project. this information
@@ -203,7 +210,7 @@ FILES
203 210
       * Enable C++ examples, i.e. for libraries: AX_BUILD_EXAMPLES
204 211
       * Check for C++11 support: AX_CXX_COMPILE_STDCXX_11 (see ax_cxx_compile_stdcxx_11.m4)
205 212
       * Require a QT module: AX_REQUIRE_QT (see ax_check_qt.m4)
206
-      * Optionally use a QT module: AX_CHECK_QT (see ax_check_qt.m4)
213
+      * Optionally use a QT module: AX_CHECK_QT  (see ax_check_qt.m4)
207 214
       * Require a module: AX_PKG_REQUIRE (see ax_init_standard_project.m4)
208 215
       * Check for an optional module: AX_PKG_CHECK (see ax_init_standard_project.m4)
209 216
 
@@ -275,7 +282,8 @@ run() {
275 282
 }
276 283
 
277 284
 testtag() {
278
-    egrep -q '^ *'"$1" configure.ac
285
+    local IFS="|"
286
+    egrep -q '^ *'"($*)" configure.ac
279 287
 }
280 288
 
281 289
 contains() {
@@ -380,6 +388,9 @@ copy ${MY_NAME}
380 388
 copy ax_init_standard_project.m4
381 389
 copy ax_cxx_compile_stdcxx_11.m4
382 390
 copy ax_check_qt.m4
391
+copy resolve-debbuilddeps.sh
392
+copy resolve-rpmbuilddeps.sh
393
+copy build-resource-file.sh
383 394
 copy mac-create-app-bundle.sh
384 395
 AUTHOR=$(gpg -K  | sed -n 's,uid *,,p' | sort | head -1)
385 396
 if test -z "${AUTHOR}"; then
@@ -388,6 +399,14 @@ fi
388 399
 to AUTHORS <<EOF && notice "please edit AUTHORS"
389 400
 $AUTHOR
390 401
 EOF
402
+to NEWS <<EOF && notice "please edit NEWS"
403
+$(date) created ${DEFAULT_PROJECT_NAME}
404
+EOF
405
+to README <<EOF && notice "please edit README"
406
+${DEFAULT_PROJECT_NAME}
407
+
408
+add description for ${DEFAULT_PROJECT_NAME}
409
+EOF
391 410
 to configure.ac <<EOF && \
392 411
     ( notice "please edit configure.ac, then rerun $0"; exit 0 )
393 412
 ${HEADER}m4_define(x_package_name, ${DEFAULT_PROJECT_NAME}) # project's name
@@ -411,6 +430,7 @@ AX_INIT_STANDARD_PROJECT
411 430
 
412 431
 # qt features, uncomment, what you need:
413 432
 #AX_CHECK_QT([QT], [QtCore QtGui QtNetwork], [QtWidgets])
433
+#AX_REQUIRE_QT([QT], [QtCore QtGui QtNetwork], [QtWidgets])
414 434
 #AX_QT_NO_KEYWORDS
415 435
 
416 436
 # create output
@@ -682,7 +702,7 @@ EOF
682 702
 Source: @PACKAGE_NAME@
683 703
 Priority: extra
684 704
 Maintainer: @AUTHOR@
685
-Build-Depends: debhelper, subversion, pkg-config, autotools-dev, lsb-release $(if testtag AX_USE_DOXYGEN; then echo -n ", doxygen, graphviz, mscgen"; fi; if testtag AX_USE_CPPUNIT; then echo -n ", libcppunit-dev"; fi; if testtag AX_CXX_QT || testtag AX_CXX_CHECK_QT; then echo -n ", qtbase5-dev | libqt4-dev, qtbase5-dev-tools | qt4-dev-tools"; fi)
705
+Build-Depends: debhelper, subversion, pkg-config, autotools-dev, lsb-release $(if testtag AX_USE_DOXYGEN; then echo -n ", doxygen, graphviz, mscgen"; fi; if testtag AX_USE_CPPUNIT; then echo -n ", libcppunit-dev"; fi; if testtag AX_CXX_QT || testtag AX_CHECK_QT AX_REQUIRE_QT; then echo -n ", qt5-default | qt4-default | qt5-qmake | qt4-qmake, qtbase5-dev | libqt4-dev, qtbase5-dev-tools | qt4-dev-tools, qttools5-dev-tools | qt4-dev-tools, qttools5-dev-tools | qt4-dev-tools"; fi)
686 706
 
687 707
 Package: @PACKAGE_NAME@
688 708
 Section: $(if testtag AX_USE_LIBTOOL; then echo  "libs"; fi)
@@ -715,6 +735,7 @@ usr/lib/lib*.a
715 735
 usr/lib/lib*.so
716 736
 usr/lib/pkgconfig/*
717 737
 usr/lib/*.la
738
+usr/share/${PACKAGE_NAME}
718 739
 usr/share/doc/${PACKAGE_NAME}/html
719 740
 EOF
720 741
     to --mode "u=rwx,g=rwx,o=rx" debian/rules <<EOF
@@ -750,9 +771,9 @@ BuildRequires: pkgconfig, redhat-lsb$(
750 771
     fi)
751 772
 %if ! ( 0%{?centos} || 0%{?centos_ver} || 0%{?centos_version} )
752 773
 $(if testtag AX_USE_DOXYGEN; then echo -n "BuildRequires: mscgen"; fi)
753
-$(if testtag AX_REQUIRE_QT || testtag AX_CHECK_QT; then echo -n "BuildRequires: qt5-qtbase-devel, qt5-qttools, qt5-qtwebkit-devel"; fi)
774
+$(if testtag AX_REQUIRE_QT || testtag AX_CHECK_QT AX_REQUIRE_QT; then echo -n "BuildRequires: qt5-qtbase-devel, qt5-qttools, qt5-qtwebkit-devel"; fi)
754 775
 %else
755
-$(if testtag AX_REQUIRE_QT || testtag AX_CHECK_QT; then echo -n "BuildRequires: qt-devel"; fi)
776
+$(if testtag AX_REQUIRE_QT || testtag AX_CHECK_QT AX_REQUIRE_QT; then echo -n "BuildRequires: qt-devel"; fi)
756 777
 %endif
757 778
 %else%if 0%{?suse_version} || 0%{?sles_version}
758 779
 BuildRequires: pkg-config, lsb-release$(
@@ -760,9 +781,9 @@ BuildRequires: pkg-config, lsb-release$(
760 781
       echo -n ", libcppunit-devel";
761 782
     fi)
762 783
 %if 0%{?suse_version} < 1200 ||  0%{?sles_version} < 1200
763
-$(if testtag AX_REQUIRE_QT || testtag AX_CHECK_QT; then echo -n "BuildRequires: libqt4-devel, qt4-x11-tools, libQtWebKit-devel"; fi)
784
+$(if testtag AX_REQUIRE_QT || testtag AX_CHECK_QT AX_REQUIRE_QT; then echo -n "BuildRequires: libqt4-devel, qt4-x11-tools, libQtWebKit-devel"; fi)
764 785
 %else
765
-$(if testtag AX_REQUIRE_QT || testtag AX_CHECK_QT; then echo -n "BuildRequires: libqt5-qtbase-devel, libqt5-qttools, libQt5WebKit5-devel"; fi)
786
+$(if testtag AX_REQUIRE_QT || testtag AX_CHECK_QT AX_REQUIRE_QT; then echo -n "BuildRequires: libqt5-qtbase-devel, libqt5-qttools, libQt5WebKit5-devel"; fi)
766 787
 %endif
767 788
 %endif%endif
768 789
 
@@ -777,6 +798,7 @@ fi)
777 798
 %prep
778 799
 %setup -q
779 800
 ./configure --prefix=/usr \\
801
+            --sysconfdir=/etc \\
780 802
             --docdir=/usr/share/doc/packages/@PACKAGE_NAME@ \\
781 803
             --libdir=/usr/%_lib
782 804
 
@@ -794,7 +816,7 @@ rm -rf \$RPM_BUILD_ROOT
794 816
 $(if testtag AX_USE_LIBTOOL; then
795 817
 echo '/usr/%_lib/@PACKAGE_NAME@.so.*'
796 818
 else
797
-echo /usr/bin/*
819
+echo '/usr/bin/*'
798 820
 fi)
799 821
 %doc
800 822
 $(if testtag AX_USE_LIBTOOL; then
@@ -807,7 +829,7 @@ $(if testtag AX_USE_LIBTOOL; then
807 829
 /usr/share/doc/packages/@PACKAGE_NAME@/README
808 830
 EOF2
809 831
 else
810
-  echo /usr/share/*
832
+  echo '/usr/share/*'
811 833
 fi)
812 834
 
813 835
 $(if testtag AX_USE_LIBTOOL; then
@@ -830,6 +852,7 @@ This Package contains all files required for developement.
830 852
 /usr/%_lib/pkgconfig
831 853
 /usr/include/*
832 854
 %doc
855
+/usr/share/@PACKAGE_NAME@
833 856
 /usr/share/doc/packages/@PACKAGE_NAME@/html
834 857
 EOF2
835 858
 fi)
@@ -853,6 +876,7 @@ ${HEADER}prefix=@prefix@
853 876
 exec_prefix=@exec_prefix@
854 877
 libdir=\${exec_prefix}/lib
855 878
 includedir=\${prefix}/include
879
+translationsdir=@datadir@/@PACKAGE_NAME@/translations
856 880
 
857 881
 Name: @PACKAGE_NAME@
858 882
 Description: @DESCRIPTION@
@@ -870,7 +894,7 @@ fi
870 894
 #### Bootstrap Before Configure ####
871 895
 run --no-check svn2cl
872 896
 run aclocal
873
-run libtoolize --force
897
+if testtag AX_USE_LIBTOOL; then run libtoolize --force; fi
874 898
 run automake -a
875 899
 run autoconf
876 900
 

+ 31
- 0
build-resource-file.sh View File

@@ -0,0 +1,31 @@
1
+#! /bin/bash -ex
2
+
3
+## @id $Id$
4
+
5
+## build resource.qrc file from a resource directory
6
+##
7
+## Argument: $1: resource path (default: resources)
8
+## Result: file named <resource-path>.qrc (default: resources.qrc)
9
+##
10
+## Call:
11
+##
12
+##   cd src
13
+##   ../build-resource-file.sh
14
+
15
+##       1         2         3         4         5         6         7         8
16
+## 45678901234567890123456789012345678901234567890123456789012345678901234567890
17
+
18
+RESOURCES=${1:-resources}
19
+TARGET=${RESOURCES}.qrc
20
+
21
+test -d ${RESOURCES}
22
+
23
+echo "<RCC>" > ${TARGET}
24
+for d in $(find resources -mindepth 1 -type d); do
25
+    echo "  <qresource prefix=\"${d#${RESOURCES}/}\">" >> ${TARGET}
26
+    for f in $(find $d -mindepth 1 -maxdepth 1 -type f); do
27
+        echo "    <file alias=\"${f##*/}\">$f</file>" >> ${TARGET}
28
+    done
29
+    echo "  </qresource>" >> ${TARGET}
30
+done
31
+echo "</RCC>" >> ${TARGET}

+ 44
- 0
resolve-debbuilddeps.sh View File

@@ -0,0 +1,44 @@
1
+#! /bin/bash -ex
2
+
3
+## @id $Id$
4
+
5
+## Resolve Debian Build Dependencies
6
+## Installs all the required packages
7
+## Call: ./resolve-debbuilddeps 'name of build schroot'
8
+## e.g. call: ./resolve-debbuilddeps trusty_amd64
9
+
10
+##       1         2         3         4         5         6         7         8
11
+## 45678901234567890123456789012345678901234567890123456789012345678901234567890
12
+
13
+SCHROOTNAME="$1"
14
+
15
+sed 's,@[^@]*@, dummytext,g' debian/control.in > debian/control
16
+
17
+if test -n "${SCHROOTNAME}"; then
18
+  DEPS=$(schroot -c "${SCHROOTNAME}" -- dpkg-checkbuilddeps 2>&1 || true)
19
+else
20
+  DEPS=$(dpkg-checkbuilddeps 2>&1 || true)
21
+fi
22
+DEPS=$(echo "$DEPS" | sed -n '/Unmet build dependencies/ { s,.*Unmet build dependencies: ,,g; s, ([^)]*),,g; s, *| *,|,g; p}')
23
+
24
+for pa in ${DEPS}; do
25
+    success=0
26
+    for p in $(echo "${pa}" | sed 's,|, ,g'); do
27
+        if test -n "${SCHROOTNAME}"; then
28
+            if schroot -c "${SCHROOTNAME}" -u root -d / -- apt-get -y install ${p}; then
29
+                success=1
30
+                break;
31
+            fi
32
+        else
33
+            if sudo apt-get -y install ${p}; then
34
+                success=1
35
+                break;
36
+            fi
37
+        fi
38
+    done
39
+    if test ${success} -eq 0; then
40
+        echo "**** Error: Installation Failed: ${pa}"
41
+    fi
42
+done
43
+
44
+echo "**** Success: All Dependencies Resolved"

+ 34
- 0
resolve-rpmbuilddeps.sh View File

@@ -0,0 +1,34 @@
1
+#! /bin/bash -ex
2
+
3
+## @id $Id$
4
+
5
+## Resolve RPM Build Dependencies
6
+## Installs all the required packages
7
+## Call: ./resolve-rpmbuilddeps 'name of build schroot'
8
+## e.g. call: ./resolve-rpmbuilddeps opensuse-13.2_x86_64
9
+
10
+##       1         2         3         4         5         6         7         8
11
+## 45678901234567890123456789012345678901234567890123456789012345678901234567890
12
+
13
+SCHROOTNAME="$1"
14
+PACKAGE_NAME=$(sed -n 's/^ *m4_define(x_package_name, \(.*\)).*/\1/p' configure.ac)
15
+
16
+sed 's,@[^@]*@,dummytext,g' ${PACKAGE_NAME}.spec.in > ${PACKAGE_NAME}.spec
17
+
18
+if test -n "${SCHROOTNAME}"; then
19
+    FILES=$(LANG= schroot -c ${SCHROOTNAME} -- rpmbuild -bb --define "_topdir ." --define "_sourcedir ." ${PACKAGE_NAME}.spec  2>&1 | sed -n 's, is needed by.*,,p')
20
+    if test -n "${FILES}"; then
21
+        schroot -c ${SCHROOTNAME} -u root -- yum install -y ${FILES} || \
22
+            schroot -c ${SCHROOTNAME} -u root -- zypper install -y ${FILES} || \
23
+        schroot -c ${SCHROOTNAME} -u root -- dnf install -y ${FILES}
24
+    fi
25
+else
26
+    FILES=$(LANG= rpmbuild -bb --define "_topdir ." --define "_sourcedir ." ${PACKAGE_NAME}.spec 2>&1 | sed -n 's, is needed by.*,,p')
27
+    if test -n "${FILES}"; then
28
+        yum install -y ${FILES} || \
29
+            zypper install -y ${FILES} || \
30
+            dnf install -y ${FILES}
31
+    fi
32
+fi
33
+
34
+echo "**** Success: All Dependencies Resolved"

Loading…
Cancel
Save