1 # Top level Makefile for rpm
3 include $(top_srcdir)/rpm.am
6 EXTRA_DIST = CHANGES ChangeLog CREDITS Doxyheader GROUPS INSTALL \
8 db db3/configure installplatform platform*
14 SUBDIRS += lua rpmio rpmdb lib build python scripts doc . tests
16 DIST_SUBDIRS = po misc db3 lua rpmio rpmdb lib build python scripts doc tests
18 pkgconfigdir = $(libdir)/pkgconfig
21 -I$(top_srcdir)/build \
23 -I$(top_srcdir)/rpmdb \
24 -I$(top_srcdir)/rpmio \
25 @WITH_BEECRYPT_INCLUDE@ \
27 -I$(top_srcdir)/misc \
29 AM_CPPFLAGS += -DLOCALEDIR="\"$(localedir)\""
30 AM_CPPFLAGS += -DRPMCONFIGDIR="\"@RPMCONFIGDIR@\""
31 AM_CPPFLAGS += -DLIBRPMALIAS_FILENAME="\"@RPMCONFIGDIR@/rpmpopt-${VERSION}\""
33 staticLDFLAGS = @LDFLAGS_STATIC@ @LDFLAGS_NPTL@
35 rpmbindir = `echo $(bindir) | sed -e s,usr/bin,bin,`
38 bin_PROGRAMS = rpm2cpio
40 rpmlibexec_PROGRAMS = rpmb rpmd rpmi rpmk rpmq
41 rpmconfig_SCRIPTS = find-provides find-requires mkinstalldirs \
42 config.guess config.sub
44 rpm_SOURCES = rpmqv.c debug.h system.h
45 rpm_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV
46 rpm_LDADD = build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
47 rpm_LDADD += @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
49 rpmb_SOURCES = build.c rpmqv.c build.h debug.h system.h
50 rpmb_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMBT
51 rpmb_LDADD = build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
52 rpmb_LDADD += @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
54 rpmd_SOURCES = rpmqv.c debug.h system.h
55 rpmd_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMDB
56 rpmd_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
57 rpmd_LDADD += @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
59 rpmi_SOURCES = rpmqv.c debug.h system.h
60 rpmi_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMEIU
61 rpmi_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
62 rpmi_LDADD += @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
64 rpmk_SOURCES = rpmqv.c debug.h system.h
65 rpmk_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMK
66 rpmk_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
67 rpmk_LDADD += @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
69 rpmq_SOURCES = rpmqv.c debug.h system.h
70 rpmq_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMQV
71 rpmq_LDADD = build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
72 rpmq_LDADD += @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
74 rpm2cpio_SOURCES = rpm2cpio.c debug.h system.h
75 rpm2cpio_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la
76 rpm2cpio_LDADD += @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
81 rpmconfig_SCRIPTS += scripts/find-debuginfo.sh
83 rpmlibexec_PROGRAMS += debugedit
84 debugedit_SOURCES = tools/debugedit.c tools/hashtab.c tools/hashtab.h
85 debugedit_LDADD = @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ @WITH_POPT_LIB@
89 rpmlibexec_PROGRAMS += javadeps
90 javadeps_SOURCES = tools/javadeps.c
93 rpmlibexec_PROGRAMS += rpmcache
94 rpmcache_SOURCES = tools/rpmcache.c
95 rpmcache_LDADD = lib/librpm.la
97 rpmlibexec_PROGRAMS += rpmdeps
98 rpmdeps_SOURCES = tools/rpmdeps.c
99 rpmdeps_LDADD = build/librpmbuild.la
101 bin_PROGRAMS += rpmgraph
102 rpmgraph_SOURCES = tools/rpmgraph.c
103 rpmgraph_LDADD = lib/librpm.la
105 dist_bin_SCRIPTS = scripts/gendiff
107 check_PROGRAMS = dumpdb
108 dumpdb_SOURCES = tools/dumpdb.c
109 dumpdb_LDADD = lib/librpm.la
111 check_PROGRAMS += convertdb1
112 convertdb1_SOURCES = tools/convertdb1.c
113 convertdb1_LDADD = lib/librpm.la
115 check_PROGRAMS += rpminject
116 rpminject_SOURCES = tools/rpminject.c
117 rpminject_LDADD = build/librpmbuild.la
119 check_PROGRAMS += rpmsort
120 rpmsort_SOURCES = tools/rpmsort.c
121 rpmsort_LDADD = lib/librpm.la
123 rpmconfig_DATA = rpmrc
124 rpmrc: $(top_srcdir)/rpmrc.in
126 -e "s,[@]SYSCONFIGDIR[@],$(sysconfdir)/rpm,g" \
127 < $(top_srcdir)/rpmrc.in > rpmrc.tmp \
128 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmrc:${subdir}/rpmrc.tmp )
129 CLEANFILES += rpmrc.tmp rpmrc
130 EXTRA_DIST += rpmrc.in
132 rpmconfig_DATA += macros
133 macros: $(top_srcdir)/macros.in
135 -e "s,[@]varprefix[@],$(localstatedir),g" \
136 < $(top_srcdir)/macros.in > macros.tmp \
137 && ( cd $(top_builddir) && ./config.status --file=${subdir}/macros:${subdir}/macros.tmp )
138 CLEANFILES += macros.tmp macros
139 EXTRA_DIST += macros.in
141 noinst_DATA = platform
142 platform: $(top_srcdir)/platform.in
144 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
145 < $(top_srcdir)/platform.in > platform.tmp \
146 && ( cd $(top_builddir) && ./config.status --file=${subdir}/platform:${subdir}/platform.tmp )
147 CLEANFILES += platform.tmp platform
148 EXTRA_DIST += platform.in
150 pkgconfig_DATA = rpm.pc
151 rpm.pc: $(top_srcdir)/rpm.pc.in
153 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
154 < $(top_srcdir)/rpm.pc.in > rpm.pc.tmp \
155 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpm.pc:${subdir}/rpm.pc.tmp )
156 CLEANFILES += rpm.pc.tmp rpm.pc
157 EXTRA_DIST += rpm.pc.in
159 rpmconfig_DATA += rpmpopt-$(VERSION)
160 rpmpopt-@VERSION@: $(top_srcdir)/rpmpopt.in
162 -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
163 < $(top_srcdir)/rpmpopt.in > rpmpopt-@VERSION@.tmp \
164 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmpopt-@VERSION@:${subdir}/rpmpopt-@VERSION@.tmp )
165 CLEANFILES += rpmpopt-@VERSION@.tmp rpmpopt-@VERSION@
166 EXTRA_DIST += rpmpopt.in
168 pkgsrcdir = $(prefix)/src/$(RPMCANONVENDOR)
169 pkgsrc_RPMSdir = $(pkgsrcdir)/RPMS
171 pkgsrc_SRPMSdir = $(pkgsrcdir)/SRPMS
173 pkgsrc_SPECSdir = $(pkgsrcdir)/SPECS
175 pkgsrc_SOURCESdir = $(pkgsrcdir)/SOURCES
176 pkgsrc_SOURCES_DATA =
177 pkgsrc_BUILDdir = $(pkgsrcdir)/BUILD
180 rpmvardir = $(localstatedir)/lib/rpm
184 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmt
185 @@LN_S@ rpmb $(DESTDIR)$(rpmlibexecdir)/rpmt
186 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpme
187 @@LN_S@ rpmi $(DESTDIR)$(rpmlibexecdir)/rpme
188 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmu
189 @@LN_S@ rpmi $(DESTDIR)$(rpmlibexecdir)/rpmu
190 @rm -f $(DESTDIR)$(rpmlibexecdir)/rpmv
191 @@LN_S@ rpmq $(DESTDIR)$(rpmlibexecdir)/rpmv
192 rm -f $(DESTDIR)$(bindir)/rpmbuild
193 @LN_S@ ../lib/rpm/rpmb $(DESTDIR)$(bindir)/rpmbuild
194 rm -f $(DESTDIR)$(bindir)/rpmquery
195 @LN_S@ ../lib/rpm/rpmq $(DESTDIR)$(bindir)/rpmquery
196 rm -f $(DESTDIR)$(bindir)/rpmverify
197 @LN_S@ ../lib/rpm/rpmv $(DESTDIR)$(bindir)/rpmverify
198 rm -f $(DESTDIR)$(bindir)/rpmsign
199 @LN_S@ ../lib/rpm/rpmk $(DESTDIR)$(bindir)/rpmsign
200 rm -f $(DESTDIR)$(bindir)/rpmdb ; \
201 @LN_S@ ../lib/rpm/rpmd $(DESTDIR)$(bindir)/rpmdb ; \
202 for bf in e i u ; do \
203 rm -f $(DESTDIR)$(bindir)/rpm$$bf ; \
204 @LN_S@ ../lib/rpm/rpm$$bf $(DESTDIR)$(bindir)/rpm$$bf ; \
208 @case "@host_cpu@" in \
209 *86) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i386 ;\
210 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i486 ;\
211 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i586 ;\
212 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i686 ;\
213 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/athlon ;;\
214 alpha*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/alpha ;\
215 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/alphaev6 ;;\
216 arm*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv3l ;\
217 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4l ;\
218 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4tl ;\
219 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv5tel ;\
220 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv5tejl ;\
221 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv6l ;;\
222 sparc*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc ;\
223 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv8 ;\
224 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv9 ;\
225 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv9v ;\
226 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc64 ;\
227 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc64v ;;\
228 ia64*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ia64 ;;\
229 s390*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/s390 ;;\
230 mipsel*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/mipsel ;;\
231 mips*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/mips ;;\
232 powerpc*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc ;\
233 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppciseries ;\
234 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppcpseries ;\
235 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64 ;\
236 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64iseries ;\
237 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64pseries ;;\
238 *) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/@host_cpu@ ;;\
240 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/noarch
241 @case "@host_os@" in \
242 mint) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/m68kmint ;;\
243 solaris*|linux*|darwin*) \
244 DESTDIR="$(DESTDIR)" pkglibdir="$(rpmconfigdir)" $(SHELL) $(top_srcdir)/installplatform rpmrc macros platform ;; \
246 @$(MKDIR_P) $(DESTDIR)$(localstatedir)/tmp
248 # XXX to appease distcheck we need to remove "stuff" here...
250 @rm -rf $(DESTDIR)/$(rpmconfigdir)/*-*
251 rm -f $(DESTDIR)$(rpmlibexecdir)/rpmu
252 rm -f $(DESTDIR)$(rpmlibexecdir)/rpme
253 rm -f $(DESTDIR)$(rpmlibexecdir)/rpmt
254 rm -f $(DESTDIR)$(rpmlibexecdir)/rpmv
255 rm -f $(DESTDIR)$(bindir)/rpmquery
256 rm -f $(DESTDIR)$(bindir)/rpmbuild
257 rm -f $(DESTDIR)$(bindir)/rpmu
258 rm -f $(DESTDIR)$(bindir)/rpmsign
259 rm -f $(DESTDIR)$(bindir)/rpme
260 rm -f $(DESTDIR)$(bindir)/rpmverify
261 rm -f $(DESTDIR)$(bindir)/rpmdb
262 rm -f $(DESTDIR)$(bindir)/rpmi
265 @rm -rf Doxytags apidocs
266 @rm -f stamp-h.in db3/*.orig db3/db3lobjs
268 MAINTAINERCLEANFILES = ChangeLog
272 @for f in $(rpmbin_PROGRAMS) ; do\
273 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(rpmbindir)/$$f ;\
274 $(__CHMOD) g+s $(DESTDIR)$(rpmbindir)/$$f ;\
276 @for f in $(bin_PROGRAMS) ; do\
277 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(bindir)/$$f ;\
279 @for f in $(rpmlibexec_PROGRAMS) ; do\
280 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(rpmlibexecdir)/$$f ;\
281 $(__CHMOD) g+s $(DESTDIR)$(rpmlibexecdir)/$$f ;\
283 @for f in $(pkglib_SCRIPTS) ; do\
284 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)/$$f ;\
286 @$(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)
287 @$(__CHOWN) -R ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(rpmvardir)
288 -@$(__CHMOD) 0664 $(DESTDIR)$(rpmvardir)/[A-Z]*
289 -@$(__CHMOD) 0775 $(DESTDIR)$(rpmvardir)
290 -@$(__CHMOD) 0664 $(DESTDIR)$(rpmvardir)/__db.*
294 @for f in $(rpmbin_PROGRAMS) ; do\
295 $(__CHMOD) g-s $(DESTDIR)$(rpmbindir)/$$f ;\
297 @for f in $(rpmlibexec_PROGRAMS) ; do\
298 $(__CHMOD) g-s $(DESTDIR)$(rpmlibexecdir)/$$f ;\
302 doxygen @WITH_APIDOCS_TARGET@: Doxyfile rpmpopt-@VERSION@
305 - [ X"@__DOXYGEN@" != Xno ] && @__DOXYGEN@
308 hg log --no-merge -v > ChangeLog
310 ACLOCAL_AMFLAGS = -I m4