Add a brand new rpmkeys utility for keyring operations
[platform/upstream/rpm.git] / Makefile.am
1 # Top level Makefile for rpm
2
3 ACLOCAL_AMFLAGS = -I m4
4
5 DISTCHECK_CONFIGURE_FLAGS = --with-external-db
6
7 include $(top_srcdir)/rpm.am
8
9 CLEANFILES =
10 EXTRA_DIST = CHANGES ChangeLog CREDITS GROUPS INSTALL \
11         autodeps autogen.sh \
12         db3/configure installplatform platform.in
13 BUILT_SOURCES =
14
15 SUBDIRS = po misc
16 if WITH_INTERNAL_DB
17 SUBDIRS += db3
18 endif
19 if WITH_LUAEXT
20 SUBDIRS += luaext
21 endif
22 SUBDIRS += rpmio lib build python scripts fileattrs doc . tests plugins
23
24 DIST_SUBDIRS = po misc luaext rpmio lib build python scripts fileattrs doc tests plugins
25
26 pkgconfigdir = $(libdir)/pkgconfig
27
28 AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/
29 AM_CPPFLAGS += -I$(top_srcdir)/build
30 AM_CPPFLAGS += -I$(top_srcdir)/lib
31 AM_CPPFLAGS += -I$(top_srcdir)/rpmio
32 AM_CPPFLAGS += @WITH_NSS_INCLUDE@
33 AM_CPPFLAGS += @WITH_POPT_INCLUDE@
34 AM_CPPFLAGS += -I$(top_srcdir)/misc
35 AM_CPPFLAGS += -DLOCALEDIR="\"$(localedir)\""
36 AM_CPPFLAGS += -DLIBRPMALIAS_FILENAME="\"rpmpopt-${VERSION}\""
37
38 pkginclude_HEADERS =
39 nodist_pkginclude_HEADERS =
40
41 pkginclude_HEADERS += rpmio/argv.h
42 pkginclude_HEADERS += rpmio/rpmio.h
43 pkginclude_HEADERS += rpmio/rpmurl.h
44 pkginclude_HEADERS += rpmio/rpmmacro.h
45 pkginclude_HEADERS += rpmio/rpmlog.h
46 pkginclude_HEADERS += rpmio/rpmpgp.h
47 pkginclude_HEADERS += rpmio/rpmsq.h
48 pkginclude_HEADERS += rpmio/rpmstring.h
49 pkginclude_HEADERS += rpmio/rpmsw.h
50 pkginclude_HEADERS += rpmio/rpmfileutil.h
51 pkginclude_HEADERS += rpmio/rpmutil.h
52 pkginclude_HEADERS += rpmio/rpmkeyring.h
53
54 pkginclude_HEADERS += lib/header.h
55 pkginclude_HEADERS += lib/rpmdb.h
56 pkginclude_HEADERS += lib/rpmcallback.h
57 pkginclude_HEADERS += lib/rpmcli.h
58 pkginclude_HEADERS += lib/rpmlib.h
59 pkginclude_HEADERS += lib/rpmds.h
60 pkginclude_HEADERS += lib/rpmfi.h
61 pkginclude_HEADERS += lib/rpmlegacy.h
62 pkginclude_HEADERS += lib/rpmpol.h
63 pkginclude_HEADERS += lib/rpmps.h
64 pkginclude_HEADERS += lib/rpmprob.h
65 pkginclude_HEADERS += lib/rpmtag.h
66 pkginclude_HEADERS += lib/rpmtd.h
67 pkginclude_HEADERS += lib/rpmte.h
68 pkginclude_HEADERS += lib/rpmts.h
69 pkginclude_HEADERS += lib/rpmtypes.h
70 pkginclude_HEADERS += lib/rpmvf.h
71 pkginclude_HEADERS += lib/rpmplugins.h
72
73 pkginclude_HEADERS += build/rpmbuild.h
74 pkginclude_HEADERS += build/rpmfc.h
75 pkginclude_HEADERS += build/rpmspec.h
76
77
78 rpmbindir = `echo $(bindir) | $(SED) -e s,usr/bin,bin,`
79 rpmbin_PROGRAMS = rpm
80
81 bin_PROGRAMS =          rpm2cpio rpmbuild rpmkeys rpmsign
82
83 rpmlibexec_PROGRAMS =
84 rpmconfig_SCRIPTS =     find-provides find-requires mkinstalldirs \
85                         config.guess config.sub
86 DISTCLEANFILES = find-provides
87 DISTCLEANFILES += find-requires
88
89 noinst_LTLIBRARIES =            libcliutils.la
90 libcliutils_la_SOURCES =        cliutils.h cliutils.c
91 libcliutils_la_CPPFLAGS =       $(AM_CPPFLAGS)
92 libcliutils_la_LIBADD =         lib/librpm.la rpmio/librpmio.la
93 libcliutils_la_LIBADD +=        @WITH_POPT_LIB@
94
95 rpm_SOURCES =           rpmqv.c debug.h system.h
96 rpm_CPPFLAGS =          $(AM_CPPFLAGS) -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV
97 rpm_LDADD =             libcliutils.la
98 rpm_LDADD +=            build/librpmbuild.la lib/librpm.la rpmio/librpmio.la
99 rpm_LDADD +=            @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
100
101 rpmkeys_SOURCES =       rpmkeys.c debug.h system.h
102 rpmkeys_CPPFLAGS =      $(AM_CPPFLAGS)
103 rpmkeys_LDADD =         libcliutils.la
104 rpmkeys_LDADD +=        lib/librpm.la rpmio/librpmio.la
105 rpmkeys_LDADD +=        @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
106
107 rpmsign_SOURCES =       rpmsign.c debug.h system.h
108 rpmsign_CPPFLAGS =      $(AM_CPPFLAGS)
109 rpmsign_LDADD =         libcliutils.la
110 rpmsign_LDADD +=        lib/librpm.la rpmio/librpmio.la
111 rpmsign_LDADD +=        @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
112
113 rpmbuild_SOURCES =      rpmbuild.c debug.h system.h
114 rpmbuild_CPPFLAGS =     $(AM_CPPFLAGS)
115 rpmbuild_LDADD =        libcliutils.la
116 rpmbuild_LDADD +=       build/librpmbuild.la lib/librpm.la rpmio/librpmio.la
117 rpmbuild_LDADD +=       @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
118
119 rpm2cpio_SOURCES =      rpm2cpio.c debug.h system.h
120 rpm2cpio_LDADD =        lib/librpm.la rpmio/librpmio.la
121 rpm2cpio_LDADD +=       @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
122
123
124 if LIBELF
125 if LIBDWARF
126 rpmconfig_SCRIPTS += scripts/find-debuginfo.sh
127
128 rpmlibexec_PROGRAMS +=  debugedit
129 debugedit_SOURCES =     tools/debugedit.c tools/hashtab.c tools/hashtab.h
130 debugedit_LDADD =       rpmio/librpmio.la
131 debugedit_LDADD +=      @WITH_LIBELF_LIB@ @WITH_POPT_LIB@
132
133 rpmlibexec_PROGRAMS +=  elfdeps
134 elfdeps_SOURCES =       tools/elfdeps.c
135 elfdeps_LDADD =         rpmio/librpmio.la
136 elfdeps_LDADD +=        @WITH_LIBELF_LIB@ @WITH_POPT_LIB@
137 endif
138 endif
139
140 rpmlibexec_PROGRAMS +=  javadeps
141 javadeps_SOURCES =      tools/javadeps.c
142 javadeps_LDADD =
143
144 rpmlibexec_PROGRAMS +=  rpmdeps
145 rpmdeps_SOURCES =       tools/rpmdeps.c
146 rpmdeps_LDADD =         lib/librpm.la rpmio/librpmio.la build/librpmbuild.la @WITH_POPT_LIB@
147
148 bin_PROGRAMS +=         rpmgraph
149 rpmgraph_SOURCES =      tools/rpmgraph.c
150 rpmgraph_LDADD =        lib/librpm.la rpmio/librpmio.la @WITH_POPT_LIB@
151
152 dist_bin_SCRIPTS =      scripts/gendiff
153
154 rpmconfig_DATA = rpmrc
155 rpmrc: $(top_srcdir)/rpmrc.in
156         @$(SED) \
157           -e "s,[@]SYSCONFIGDIR[@],$(sysconfdir)/rpm,g" \
158           < $(top_srcdir)/rpmrc.in > rpmrc.tmp \
159           && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmrc:${subdir}/rpmrc.tmp )
160 CLEANFILES += rpmrc.tmp rpmrc
161 EXTRA_DIST += rpmrc.in
162
163 rpmconfig_DATA += macros
164 macros: $(top_srcdir)/macros.in
165           ( cd $(top_builddir) && ./config.status --file=${subdir}/macros:${subdir}/macros.in )
166 CLEANFILES += macros
167 EXTRA_DIST += macros.in
168
169 noinst_DATA = platform
170 platform: $(top_srcdir)/platform.in
171         @$(SED) \
172           -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
173           < $(top_srcdir)/platform.in > platform.tmp \
174           && ( cd $(top_builddir) && ./config.status --file=${subdir}/platform:${subdir}/platform.tmp )
175 CLEANFILES += platform.tmp platform
176 EXTRA_DIST += platform.in
177
178 pkgconfig_DATA = rpm.pc
179 rpm.pc: $(top_srcdir)/rpm.pc.in
180         @$(SED) \
181           -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
182           < $(top_srcdir)/rpm.pc.in > rpm.pc.tmp \
183           && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpm.pc:${subdir}/rpm.pc.tmp )
184 CLEANFILES += rpm.pc.tmp rpm.pc
185 EXTRA_DIST += rpm.pc.in
186
187 rpmconfig_DATA += rpmpopt-$(VERSION)
188 rpmpopt-@VERSION@: $(top_srcdir)/rpmpopt.in
189         @$(SED) \
190           -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
191           -e "s,[@]BINDIR[@],$(bindir),g" \
192           < $(top_srcdir)/rpmpopt.in > rpmpopt-@VERSION@.tmp \
193           && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmpopt-@VERSION@:${subdir}/rpmpopt-@VERSION@.tmp )
194 CLEANFILES += rpmpopt-@VERSION@.tmp rpmpopt-@VERSION@
195 EXTRA_DIST += rpmpopt.in
196
197 usrsrcdir = $(prefix)/src
198
199 rpmvardir = $(localstatedir)/lib/rpm
200 rpmvar_DATA =
201
202 install-exec-hook:
203         rm -f $(DESTDIR)$(bindir)/rpmquery
204         @LN_S@ ../../bin/rpm $(DESTDIR)$(bindir)/rpmquery
205         rm -f $(DESTDIR)$(bindir)/rpmverify
206         @LN_S@ ../../bin/rpm $(DESTDIR)$(bindir)/rpmverify
207         rm -f $(DESTDIR)$(bindir)/rpmdb
208         @LN_S@ ../../bin/rpm $(DESTDIR)$(bindir)/rpmdb
209
210 install-data-local:
211         @case "@host_os@" in \
212         solaris*|linux*|darwin*) \
213            DESTDIR="$(DESTDIR)" pkglibdir="$(rpmconfigdir)" $(SHELL) $(top_srcdir)/installplatform rpmrc macros platform ;; \
214         esac
215         @$(MKDIR_P) $(DESTDIR)$(localstatedir)/tmp
216
217 # XXX to appease distcheck we need to remove "stuff" here...
218 uninstall-local:
219         @rm -f $(DESTDIR)$(bindir)/rpmquery
220         @rm -f $(DESTDIR)$(bindir)/rpmverify
221         @rm -f $(DESTDIR)$(bindir)/rpmdb
222         @rm -rf $(DESTDIR)$(rpmconfigdir)/platform/
223
224 MAINTAINERCLEANFILES = ChangeLog
225
226 # Build hacking docs only on request
227 if HACKINGDOCS
228 if DOXYGEN
229 doc/hacking.doxy: doc/hacking.doxy.in doc/hacking/Doxyheader Makefile.am
230         $(SED) \
231           -e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
232           -e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \
233           -e "s,[@]PACKAGE[@],$(PACKAGE)," \
234           -e "s,[@]VERSION[@],$(VERSION)," \
235         < $(top_srcdir)/doc/hacking.doxy.in > doc/hacking.doxy
236
237 doc/hacking/html/index.html: doc/hacking.doxy rpmpopt-@VERSION@
238         @DOXYGEN@ doc/hacking.doxy
239 noinst_DATA += doc/hacking/html/index.html
240 endif
241 endif
242 EXTRA_DIST += doc/hacking.doxy.in doc/hacking/Doxyheader
243
244 # Always build librpm docs
245 if DOXYGEN
246 doc/librpm.doxy: doc/librpm.doxy.in doc/librpm/Doxyheader Makefile.am $(pkginclude_HEADERS)
247         files=`echo " $(HEADERS)" | $(SED) -e "s, , \@top_srcdir\@/,g"`; \
248         $(SED) -e "s,[@]pkginclude_HEADERS[@],$$files," \
249           -e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
250           -e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \
251           -e "s,[@]PACKAGE[@],$(PACKAGE)," \
252           -e "s,[@]VERSION[@],$(VERSION)," \
253         < $(top_srcdir)/doc/librpm.doxy.in > doc/librpm.doxy
254
255 doc/librpm/html/index.html: doc/librpm.doxy
256         @DOXYGEN@ doc/librpm.doxy
257 noinst_DATA += doc/librpm/html/index.html
258 endif
259 EXTRA_DIST += doc/librpm.doxy.in doc/librpm/Doxyheader
260 EXTRA_DIST += doc/librpm/html
261
262 if WITH_INTERNAL_DB
263 db.h:   $(top_builddir)/db3/db.h
264         $(LN_S) $(top_builddir)/db3/db.h $@
265 BUILT_SOURCES += db.h
266 endif
267 DISTCLEANFILES += db.h
268
269 clean-local:
270         rm -rf doc/hacking/html
271         rm -rf include
272
273 distclean-local:
274         rm -rf Doxytags
275         rm -f stamp-h.in db3/*.orig db3/db3lobjs
276
277 maintainer-clean-local:
278         rm -rf doc/librpm/html
279
280 $(top_srcdir)/preinstall.am: Makefile.am
281         rm -f $(top_srcdir)/preinstall.am
282         @for f in $(HEADERS); do \
283           b=`basename $$f`; \
284           echo 'include/rpm/'$$b': '$$f' include/rpm/$$(dirstamp)' >> $(top_srcdir)/preinstall.am;\
285           echo '        $$(INSTALL_DATA) $$(top_srcdir)/'$$f' include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
286           echo 'BUILT_SOURCES += include/rpm/'$$b >> $(top_srcdir)/preinstall.am; \
287           echo 'CLEANFILES += include/rpm/'$$b  >> $(top_srcdir)/preinstall.am; \
288          done
289
290 include/rpm/$(dirstamp):
291         @$(MKDIR_P) include/rpm
292         @: > include/rpm/$(dirstamp)
293
294 include $(top_srcdir)/preinstall.am