]> git.ipfire.org Git - pbs.git/blob - configure.ac
configure: Depend on sassc and uglifyjs
[pbs.git] / configure.ac
1 ###############################################################################
2 # #
3 # Pakfire - The IPFire package management system #
4 # Copyright (C) 2017 Pakfire development team #
5 # #
6 # This program is free software: you can redistribute it and/or modify #
7 # it under the terms of the GNU General Public License as published by #
8 # the Free Software Foundation, either version 3 of the License, or #
9 # (at your option) any later version. #
10 # #
11 # This program is distributed in the hope that it will be useful, #
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
14 # GNU General Public License for more details. #
15 # #
16 # You should have received a copy of the GNU General Public License #
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
18 # #
19 ###############################################################################
20
21 AC_PREREQ([2.64])
22
23 AC_INIT([pakfire-build-service],
24 [2017.01],
25 [info@ipfire.org],
26 [pakfire-build-service],
27 [https://git.ipfire.org/?p=pbs.git;a=summary])
28
29 AC_CONFIG_MACRO_DIR([m4])
30 AC_CONFIG_AUX_DIR([build-aux])
31
32 AC_PREFIX_DEFAULT([/usr])
33
34 AM_INIT_AUTOMAKE([
35 foreign
36 1.11
37 -Wall
38 -Wno-portability
39 silent-rules
40 tar-pax
41 subdir-objects
42 ])
43 AM_SILENT_RULES([yes])
44
45 IT_PROG_INTLTOOL([0.40.0])
46
47 GETTEXT_PACKAGE=pakfire-build-service
48 AC_SUBST(GETTEXT_PACKAGE)
49
50 AC_PROG_LN_S
51 AC_PROG_MKDIR_P
52 AC_PROG_SED
53
54 # Python
55 AM_PATH_PYTHON([3.9])
56
57 # SASSC
58 AC_CHECK_PROG(SASSC, [sassc], [sassc])
59 if test -z "${SASSC}"; then
60 AC_MSG_ERROR([sassc is required])
61 fi
62
63 # uglifyjs.terser
64 AC_CHECK_PROG(UGLIFYJS, [uglifyjs.terser], [uglifyjs.terser])
65 if test -z "${UGLIFYJS}"; then
66 AC_MSG_ERROR([uglifyjs.terser is required])
67 fi
68
69 save_LIBS="$LIBS"
70
71 # pkg-config
72 PKG_PROG_PKG_CONFIG
73 # This makes sure pkg.m4 is available.
74 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
75
76 # ------------------------------------------------------------------------------
77
78 AX_PYTHON_MODULE([location], [fatal])
79
80 # ------------------------------------------------------------------------------
81
82 AC_ARG_WITH([systemd],
83 AS_HELP_STRING([--with-systemd], [Enable systemd support.])
84 )
85
86 AS_IF([test "x$with_systemd" != "xno"],
87 [PKG_CHECK_MODULES(systemd, [libsystemd],
88 [have_systemd=yes], [have_systemd=no])],
89 [have_systemd=no]
90 )
91
92 AS_IF([test "x$have_systemd" = "xyes"],
93 [AC_MSG_CHECKING([for systemd system unit directory])
94 AC_ARG_WITH([systemdsystemunitdir],
95 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
96 [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]
97 )
98
99 AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
100
101 if test -n "$systemdsystemunitdir" -a "x$systemdsystemunitdir" != xno; then
102 AC_MSG_RESULT([$systemdsystemunitdir])
103 else
104 AC_MSG_ERROR([not found (try --with-systemdsystemunitdir)])
105 fi
106 ],
107 [AS_IF([test "x$with_systemd" = "xyes"],
108 [AC_MSG_ERROR([Systemd support is enabled but no systemd has been found.])
109 ])
110 ])
111
112 AM_CONDITIONAL(HAVE_SYSTEMD, [test "x$have_systemd" = "xyes"])
113
114 # ------------------------------------------------------------------------------
115
116 datadir="${datadir}/pakfire-build-service"
117 localedir="${datadir}/translations"
118
119 AC_CONFIG_FILES([
120 Makefile
121 po/Makefile.in
122 src/buildservice/__version__.py
123 ])
124
125 AC_OUTPUT
126 AC_MSG_RESULT([
127 ${PACKAGE_NAME} ${VERSION}
128
129 prefix: ${prefix}
130 sysconfdir: ${sysconfdir}
131
132 Systemd support ${have_systemd}
133 ])