rpm/Makefile.am

331 lines
10 KiB
Makefile
Raw Normal View History

# Top level Makefile for rpm
2007-10-17 00:22:23 +08:00
ACLOCAL_AMFLAGS = -I m4
DISTCHECK_CONFIGURE_FLAGS = --with-external-db
2007-09-05 16:41:55 +08:00
include $(top_srcdir)/rpm.am
AM_CFLAGS = @RPMCFLAGS@
2007-09-05 16:41:55 +08:00
2007-08-28 19:19:37 +08:00
CLEANFILES =
EXTRA_DIST = ChangeLog CREDITS INSTALL \
autogen.sh db3/configure installplatform platform.in
2007-11-22 22:54:42 +08:00
BUILT_SOURCES =
SUBDIRS = po misc
if WITH_INTERNAL_DB
SUBDIRS += db3
endif
if WITH_LUA
SUBDIRS += luaext
endif
SUBDIRS += rpmio lib sign build scripts fileattrs doc .
if ENABLE_PYTHON
SUBDIRS += python
endif
if ENABLE_PLUGINS
SUBDIRS += plugins
endif
if HAVE_FAKECHROOT
SUBDIRS += tests
endif
DIST_SUBDIRS = po misc luaext rpmio lib sign build python scripts fileattrs doc tests plugins
2007-07-25 20:36:58 +08:00
pkgconfigdir = $(libdir)/pkgconfig
AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/
2007-10-17 22:41:59 +08:00
AM_CPPFLAGS += -I$(top_srcdir)/build
AM_CPPFLAGS += -I$(top_srcdir)/lib
AM_CPPFLAGS += -I$(top_srcdir)/rpmio
AM_CPPFLAGS += @WITH_BEECRYPT_INCLUDE@
AM_CPPFLAGS += @WITH_NSS_INCLUDE@
2007-10-17 22:41:59 +08:00
AM_CPPFLAGS += @WITH_POPT_INCLUDE@
AM_CPPFLAGS += -I$(top_srcdir)/misc
2007-08-28 12:46:20 +08:00
AM_CPPFLAGS += -DLOCALEDIR="\"$(localedir)\""
AM_CPPFLAGS += -DLIBRPMALIAS_FILENAME="\"rpmpopt-${VERSION}\""
pkginclude_HEADERS =
2007-10-25 00:38:18 +08:00
nodist_pkginclude_HEADERS =
pkginclude_HEADERS += rpmio/argv.h
pkginclude_HEADERS += rpmio/rpmio.h
pkginclude_HEADERS += rpmio/rpmurl.h
pkginclude_HEADERS += rpmio/rpmmacro.h
pkginclude_HEADERS += rpmio/rpmlog.h
pkginclude_HEADERS += rpmio/rpmpgp.h
pkginclude_HEADERS += rpmio/rpmsq.h
pkginclude_HEADERS += rpmio/rpmstring.h
pkginclude_HEADERS += rpmio/rpmstrpool.h
pkginclude_HEADERS += rpmio/rpmsw.h
pkginclude_HEADERS += rpmio/rpmfileutil.h
pkginclude_HEADERS += rpmio/rpmutil.h
2008-07-02 19:23:30 +08:00
pkginclude_HEADERS += rpmio/rpmkeyring.h
pkginclude_HEADERS += rpmio/rpmbase64.h
pkginclude_HEADERS += lib/header.h
pkginclude_HEADERS += lib/rpmdb.h
pkginclude_HEADERS += lib/rpmcallback.h
pkginclude_HEADERS += lib/rpmcli.h
pkginclude_HEADERS += lib/rpmlib.h
pkginclude_HEADERS += lib/rpmds.h
pkginclude_HEADERS += lib/rpmfi.h
pkginclude_HEADERS += lib/rpmfiles.h
Add new %sepolicy section to the spec file format The %sepolicy section is used to describe SELinux policy to be included in a package. It's syntax is similar to other sections (%files, %pre, %post, etc.) in that you can provide a string and -n after the declaration to specify policy should be added to a subpackage. For example: %sepolicy # policy in this section will be added to the main package %sepolicy foo # policy in this section will be added to the '<mainpackage>-foo' subpackage %sepolicy -n bar # policy in this section will be added to the 'bar' subpackage The %sepolicy section contains zero or more %semodule directives, with the following format: %semodule [OPTIONS] path/to/module.pp The available options are: -b, --base The module is a base module -n, --name=NAME The name of the module. If not given, assumes the name is the basename of the module file with file extensions removed. -t, --types=TYPES One or more comma-separated strings specifying which policy types the module can work with. To explicitly state that a module can work with any policy type, "default" can be specified as the value. If not specified, assumes the module can work with any policy type, and assigns the types as "default". Below is an example of this new format: %sepolicy %semodule -n foo -t mls policy/foo.pp %semodule -n bar -t strict,targeted,mls -b policy/bar.pp This also adds new header tags to store the new information: RPMTAG_POLICYNAMES (string array) RPMTAG_POLICYTYPES (string array) RPMTAG_POLICYTYPESINDEXES (uint32 array) RPMTAG_POLICYFLAGS (uint32 array) The index of NAMES and FLAGS maps directly to the index of RPMTAG_POLICIES. However, because a single policy can have multiple types, the mapping for TYPES is not direct. For this, the index maps to TYPESINDEXES, which contains the index of the policy that the type maps to. This is similar to how DIRINDEXES is used to map DIRNAMES and BASENAMES. As an example, the previous %sepolicy section would have the following header tags: RPMTAG_POLICIES: 0: <foo.pp data, base64 encoded> 1: <bar.pp data, base64 encoded> RPMTAG_POLICYNAMES: 0: foo 1: bar RPMTAG_POLICYFLAGS: 0: 0 1: 1 # assumes flag 1 == BASE RPMTAG_POILCYTYPES: RPMTAG_POLICYTYPESINDEXES: 0: mls 0: 0 1: strict 1: 1 2: targeted 2: 1 3: mls 3: 1
2010-08-31 04:32:29 +08:00
pkginclude_HEADERS += lib/rpmpol.h
pkginclude_HEADERS += lib/rpmps.h
pkginclude_HEADERS += lib/rpmprob.h
pkginclude_HEADERS += lib/rpmtag.h
pkginclude_HEADERS += lib/rpmtd.h
pkginclude_HEADERS += lib/rpmte.h
pkginclude_HEADERS += lib/rpmts.h
pkginclude_HEADERS += lib/rpmtypes.h
pkginclude_HEADERS += lib/rpmvf.h
2013-11-26 22:21:56 +08:00
pkginclude_HEADERS += lib/rpmarchive.h
pkginclude_HEADERS += sign/rpmsign.h
pkginclude_HEADERS += build/rpmbuild.h
pkginclude_HEADERS += build/rpmfc.h
pkginclude_HEADERS += build/rpmspec.h
bin_PROGRAMS = rpm rpm2cpio rpmbuild rpmdb rpmkeys rpmsign rpmspec
if WITH_ARCHIVE
bin_PROGRAMS += rpm2archive
endif
rpmlibexec_PROGRAMS =
rpmconfig_SCRIPTS = mkinstalldirs \
2007-08-27 22:15:29 +08:00
config.guess config.sub
noinst_LTLIBRARIES = libcliutils.la
libcliutils_la_SOURCES = cliutils.h cliutils.c
libcliutils_la_CPPFLAGS = $(AM_CPPFLAGS)
libcliutils_la_LIBADD = lib/librpm.la rpmio/librpmio.la
libcliutils_la_LIBADD += @WITH_POPT_LIB@
2007-08-08 22:54:26 +08:00
rpm_SOURCES = rpmqv.c debug.h system.h
rpm_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMEIU -DIAM_RPMQ -DIAM_RPMV
rpm_LDADD = libcliutils.la
rpm_LDADD += lib/librpm.la rpmio/librpmio.la
rpm_LDADD += @WITH_BEECRYPT_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
rpmdb_SOURCES = rpmdb.c debug.h system.h
rpmdb_CPPFLAGS = $(AM_CPPFLAGS)
rpmdb_LDADD = libcliutils.la
rpmdb_LDADD += lib/librpm.la rpmio/librpmio.la
rpmdb_LDADD += @WITH_BEECRYPT_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
rpmkeys_SOURCES = rpmkeys.c debug.h system.h
rpmkeys_CPPFLAGS = $(AM_CPPFLAGS)
rpmkeys_LDADD = libcliutils.la
rpmkeys_LDADD += lib/librpm.la rpmio/librpmio.la
rpmkeys_LDADD += @WITH_BEECRYPT_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
rpmsign_SOURCES = rpmsign.c debug.h system.h
rpmsign_CPPFLAGS = $(AM_CPPFLAGS)
rpmsign_LDADD = libcliutils.la
rpmsign_LDADD += sign/librpmsign.la lib/librpm.la rpmio/librpmio.la
rpmsign_LDADD += @WITH_BEECRYPT_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
rpmbuild_SOURCES = rpmbuild.c debug.h system.h
rpmbuild_CPPFLAGS = $(AM_CPPFLAGS)
rpmbuild_LDADD = libcliutils.la
rpmbuild_LDADD += build/librpmbuild.la lib/librpm.la rpmio/librpmio.la
rpmbuild_LDADD += @WITH_BEECRYPT_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
rpmspec_SOURCES = rpmspec.c debug.h system.h
rpmspec_CPPFLAGS = $(AM_CPPFLAGS)
rpmspec_LDADD = libcliutils.la
rpmspec_LDADD += build/librpmbuild.la lib/librpm.la rpmio/librpmio.la
rpmspec_LDADD += @WITH_BEECRYPT_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
2007-08-08 22:54:26 +08:00
rpm2cpio_SOURCES = rpm2cpio.c debug.h system.h
rpm2cpio_LDADD = lib/librpm.la rpmio/librpmio.la
rpm2cpio_LDADD += @WITH_BEECRYPT_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
rpm2archive_SOURCES = rpm2archive.c debug.h system.h
rpm2archive_LDADD = lib/librpm.la rpmio/librpmio.la
rpm2archive_LDADD += @WITH_BEECRYPT_LIB@ @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@ @WITH_ARCHIVE_LIB@
if LIBELF
if LIBDWARF
rpmconfig_SCRIPTS += scripts/find-debuginfo.sh
rpmlibexec_PROGRAMS += debugedit
debugedit_SOURCES = tools/debugedit.c tools/hashtab.c tools/hashtab.h
debugedit_LDADD = rpmio/librpmio.la
debugedit_LDADD += @WITH_LIBELF_LIB@ @WITH_POPT_LIB@
rpmlibexec_PROGRAMS += elfdeps
elfdeps_SOURCES = tools/elfdeps.c
elfdeps_LDADD = rpmio/librpmio.la
elfdeps_LDADD += @WITH_LIBELF_LIB@ @WITH_POPT_LIB@
rpmlibexec_PROGRAMS += sepdebugcrcfix
sepdebugcrcfix_SOURCES = tools/sepdebugcrcfix.c
sepdebugcrcfix_LDADD = @WITH_LIBELF_LIB@
endif
endif
rpmlibexec_PROGRAMS += rpmdeps
rpmdeps_SOURCES = tools/rpmdeps.c
rpmdeps_LDADD = lib/librpm.la rpmio/librpmio.la build/librpmbuild.la @WITH_POPT_LIB@
bin_PROGRAMS += rpmgraph
rpmgraph_SOURCES = tools/rpmgraph.c
rpmgraph_LDADD = lib/librpm.la rpmio/librpmio.la @WITH_POPT_LIB@
dist_bin_SCRIPTS = scripts/gendiff
2007-09-18 12:39:31 +08:00
rpmconfig_DATA = rpmrc
2007-08-28 19:19:37 +08:00
rpmrc: $(top_srcdir)/rpmrc.in
2007-10-17 00:21:27 +08:00
@$(SED) \
2007-08-28 19:19:37 +08:00
-e "s,[@]SYSCONFIGDIR[@],$(sysconfdir)/rpm,g" \
< $(top_srcdir)/rpmrc.in > rpmrc.tmp \
&& ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmrc:${subdir}/rpmrc.tmp )
CLEANFILES += rpmrc.tmp rpmrc
EXTRA_DIST += rpmrc.in
noinst_DATA = macros
macros: $(top_srcdir)/macros.in
( cd $(top_builddir) && ./config.status --file=${subdir}/macros:${subdir}/macros.in )
CLEANFILES += macros
EXTRA_DIST += macros.in
# Used for the testsuite to test creating debuginfo packages
EXTRA_DIST += macros.debug
noinst_DATA += platform
platform: $(top_srcdir)/platform.in
2007-10-17 00:21:27 +08:00
@$(SED) \
-e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
< $(top_srcdir)/platform.in > platform.tmp \
&& ( cd $(top_builddir) && ./config.status --file=${subdir}/platform:${subdir}/platform.tmp )
CLEANFILES += platform.tmp platform
EXTRA_DIST += platform.in
2007-09-18 12:39:31 +08:00
pkgconfig_DATA = rpm.pc
rpm.pc: $(top_srcdir)/rpm.pc.in
2007-10-17 00:21:27 +08:00
@$(SED) \
-e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
< $(top_srcdir)/rpm.pc.in > rpm.pc.tmp \
&& ( cd $(top_builddir) && ./config.status --file=${subdir}/rpm.pc:${subdir}/rpm.pc.tmp )
CLEANFILES += rpm.pc.tmp rpm.pc
EXTRA_DIST += rpm.pc.in
2007-09-18 12:39:31 +08:00
rpmconfig_DATA += rpmpopt-$(VERSION)
rpmpopt-@VERSION@: $(top_srcdir)/rpmpopt.in
2007-10-17 00:21:27 +08:00
@$(SED) \
-e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
-e "s,[@]BINDIR[@],$(bindir),g" \
< $(top_srcdir)/rpmpopt.in > rpmpopt-@VERSION@.tmp \
&& ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmpopt-@VERSION@:${subdir}/rpmpopt-@VERSION@.tmp )
CLEANFILES += rpmpopt-@VERSION@.tmp rpmpopt-@VERSION@
EXTRA_DIST += rpmpopt.in
usrsrcdir = $(prefix)/src
rpmvardir = $(localstatedir)/lib/rpm
rpmvar_DATA =
install-exec-hook:
@rm -f $(DESTDIR)$(bindir)/rpmquery
@LN_S@ $(rpm_symlink_prefix)rpm $(DESTDIR)$(bindir)/rpmquery
@rm -f $(DESTDIR)$(bindir)/rpmverify
@LN_S@ $(rpm_symlink_prefix)rpm $(DESTDIR)$(bindir)/rpmverify
install-data-local:
DESTDIR="$(DESTDIR)" pkglibdir="$(rpmconfigdir)" \
$(SHELL) $(top_srcdir)/installplatform \
rpmrc platform macros \
$(RPMCANONVENDOR) $(RPMCANONOS) $(RPMCANONGNU)
2007-08-31 22:27:10 +08:00
@$(MKDIR_P) $(DESTDIR)$(localstatedir)/tmp
# XXX to appease distcheck we need to remove "stuff" here...
uninstall-local:
@rm -f $(DESTDIR)$(bindir)/rpmquery
@rm -f $(DESTDIR)$(bindir)/rpmverify
2009-05-22 15:04:20 +08:00
@rm -rf $(DESTDIR)$(rpmconfigdir)/platform/
@rm -f $(DESTDIR)$(rpmconfigdir)/macros
2007-09-07 15:17:34 +08:00
MAINTAINERCLEANFILES = ChangeLog
# Build hacking docs only on request
if HACKINGDOCS
2007-10-19 00:13:02 +08:00
if DOXYGEN
2007-10-19 23:22:08 +08:00
doc/hacking.doxy: doc/hacking.doxy.in doc/hacking/Doxyheader Makefile.am
2007-10-25 00:26:07 +08:00
$(SED) \
2007-10-19 23:22:08 +08:00
-e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
-e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \
2007-10-25 00:26:07 +08:00
-e "s,[@]PACKAGE[@],$(PACKAGE)," \
-e "s,[@]VERSION[@],$(VERSION)," \
2007-10-19 23:22:08 +08:00
< $(top_srcdir)/doc/hacking.doxy.in > doc/hacking.doxy
doc/hacking/html/index.html: doc/hacking.doxy rpmpopt-@VERSION@
@DOXYGEN@ doc/hacking.doxy
noinst_DATA += doc/hacking/html/index.html
2007-10-19 00:13:02 +08:00
endif
endif
2007-10-19 23:22:08 +08:00
EXTRA_DIST += doc/hacking.doxy.in doc/hacking/Doxyheader
2007-10-19 00:13:02 +08:00
# Always build librpm docs
if DOXYGEN
doc/librpm.doxy: doc/librpm.doxy.in doc/librpm/Doxyheader Makefile.am configure.ac $(pkginclude_HEADERS)
files=`echo " $(pkginclude_HEADERS)" | $(SED) -e "s, , \@top_srcdir\@/,g"`; \
2007-10-19 23:22:08 +08:00
$(SED) -e "s,[@]pkginclude_HEADERS[@],$$files," \
-e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
-e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \
-e "s,[@]PACKAGE[@],$(PACKAGE)," \
-e "s,[@]VERSION[@],$(VERSION)," \
< $(top_srcdir)/doc/librpm.doxy.in > doc/librpm.doxy
doc/librpm/html/index.html: doc/librpm.doxy
@DOXYGEN@ doc/librpm.doxy
noinst_DATA += doc/librpm/html/index.html
2007-10-19 00:13:02 +08:00
endif
2007-10-19 23:22:08 +08:00
EXTRA_DIST += doc/librpm.doxy.in doc/librpm/Doxyheader
2007-10-19 00:13:02 +08:00
EXTRA_DIST += doc/librpm/html
if WITH_INTERNAL_DB
db.h: $(top_builddir)/db3/db.h
$(LN_S) $(top_builddir)/db3/db.h $@
2007-11-22 22:54:42 +08:00
BUILT_SOURCES += db.h
endif
DISTCLEANFILES = db.h
2007-10-19 00:13:02 +08:00
ChangeLog:
touch ChangeLog
dist-hook:
if [ -d .git ] && [ -x $(command -v git) ]; then git log --no-merges > $(distdir)/ChangeLog; fi
2007-10-19 00:13:02 +08:00
clean-local:
2007-10-19 23:22:08 +08:00
rm -rf doc/hacking/html
2007-11-22 22:54:42 +08:00
rm -rf include
2007-10-19 00:13:02 +08:00
distclean-local:
rm -rf doc/librpm.doxy doc/librpm/html
2007-10-19 00:13:02 +08:00
rm -rf Doxytags
rm -f stamp-h.in db3/*.orig db3/db3lobjs
2007-11-22 22:54:42 +08:00
$(top_srcdir)/preinstall.am: Makefile.am
rm -f $(top_srcdir)/preinstall.am
2007-11-22 22:54:42 +08:00
@for f in $(HEADERS); do \
b=`basename $$f`; \
echo 'include/rpm/'$$b': '$$f' include/rpm/$$(dirstamp)' >> $(top_srcdir)/preinstall.am;\
2007-11-23 13:28:09 +08:00
echo ' $$(INSTALL_DATA) $$(top_srcdir)/'$$f' include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
2007-11-22 22:54:42 +08:00
echo 'BUILT_SOURCES += include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
echo 'CLEANFILES += include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
done
include/rpm/$(dirstamp):
@$(MKDIR_P) include/rpm
@: > include/rpm/$(dirstamp)
include $(top_srcdir)/preinstall.am