1 # Top level Makefile for rpm
6 EXTRA_DIST = CHANGES ChangeLog CREDITS Doxyheader GROUPS INSTALL \
8 db db3/configure installplatform platform*
10 SUBDIRS = po misc @WITH_DB_SUBDIR@ lua rpmio rpmdb lib build python tools scripts doc . tests
12 pkgconfigdir = $(libdir)/pkgconfig
13 pkgconfig_DATA = rpm.pc
16 -I$(top_srcdir)/build \
18 -I$(top_srcdir)/rpmdb \
19 -I$(top_srcdir)/rpmio \
20 @WITH_BEECRYPT_INCLUDE@ \
22 -I$(top_srcdir)/misc \
24 AM_CPPFLAGS += -DLOCALEDIR="\"$(localedir)\""
25 AM_CPPFLAGS += -DRPMCONFIGDIR="\"@RPMCONFIGDIR@\""
26 AM_CPPFLAGS += -DLIBRPMALIAS_FILENAME="\"@RPMCONFIGDIR@/rpmpopt-${VERSION}\""
28 staticLDFLAGS = @LDFLAGS_STATIC@ @LDFLAGS_NPTL@
30 rpmbindir = `echo $(bindir) | sed -e s,usr/bin,bin,`
33 bin_PROGRAMS = rpm2cpio
35 pkglibdir = @RPMCONFIGDIR@
36 pkglib_PROGRAMS = rpmb rpmd rpmi rpmk rpmq
37 pkglib_DATA = rpmrc rpmpopt-$(VERSION) macros
38 pkglib_SCRIPTS = find-provides find-requires mkinstalldirs \
39 config.guess config.sub
41 rpm_SOURCES = rpmqv.c debug.h system.h
42 rpm_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV
43 rpm_LDFLAGS = @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@
44 rpm_LDADD = build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
46 rpmb_SOURCES = build.c rpmqv.c build.h debug.h system.h
47 rpmb_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMBT
48 rpmb_LDFLAGS = @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@
49 rpmb_LDADD = build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
51 rpmd_SOURCES = rpmqv.c debug.h system.h
52 rpmd_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMDB
53 rpmd_LDFLAGS = @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@
54 rpmd_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
56 rpmi_SOURCES = rpmqv.c debug.h system.h
57 rpmi_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMEIU
58 #rpmi_LDFLAGS = @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@ $(staticLDFLAGS)
59 rpmi_LDFLAGS = @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@
60 rpmi_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
62 rpmk_SOURCES = rpmqv.c debug.h system.h
63 rpmk_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMK
64 rpmk_LDFLAGS = @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@
65 rpmk_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
67 rpmq_SOURCES = rpmqv.c debug.h system.h
68 rpmq_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMQV
69 rpmq_LDFLAGS = @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@
70 rpmq_LDADD = build/librpmbuild.la lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
72 rpm2cpio_SOURCES = rpm2cpio.c debug.h system.h
73 rpm2cpio_LDFLAGS = @WITH_LIBELF_LIB@ @WITH_BEECRYPT_LIB@
74 rpm2cpio_LDADD = lib/librpm.la rpmdb/librpmdb.la rpmio/librpmio.la @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
76 rpmrc: $(top_srcdir)/rpmrc.in
78 -e "s,[@]SYSCONFIGDIR[@],$(sysconfdir)/rpm,g" \
79 < $(top_srcdir)/rpmrc.in > rpmrc.tmp \
80 && ( cd $(top_builddir) && ./config.status --file=${subdir}/rpmrc:${subdir}/rpmrc.tmp )
81 CLEANFILES += rpmrc.tmp rpmrc
82 EXTRA_DIST += rpmrc.in
84 macros: $(top_srcdir)/macros.in
86 -e "s,[@]varprefix[@],$(localstatedir),g" \
87 < $(top_srcdir)/macros.in > macros.tmp \
88 && ( cd $(top_builddir) && ./config.status --file=${subdir}/macros:${subdir}/macros.tmp )
89 CLEANFILES += macros.tmp macros
90 EXTRA_DIST += macros.in
95 -load build/rpmbuild.lcd \
96 -load lib/rpmlib.lcd \
97 -load rpmdb/rpmdb.lcd \
98 -load rpmio/rpmio.lcd \
99 $(DEFS) $(AM_CPPFLAGS) rpmqv.c $(rpmb_SOURCES)
103 $(LINT) -Dlint $(DEFS) $(AM_CPPFLAGS) rpmqv.c $(rpmb_SOURCES) \
104 `make -s sources -C build` \
105 `make -s sources -C lib` \
106 `make -s sources -C rpmdb` \
107 `make -s sources -C rpmio`
109 pkgsrcdir = $(prefix)/src/$(RPMCANONVENDOR)
111 rpmvardir = $(localstatedir)/lib/rpm
115 @rm -f $(DESTDIR)$(pkglibdir)/rpmt
116 @@LN_S@ rpmb $(DESTDIR)$(pkglibdir)/rpmt
117 @rm -f $(DESTDIR)$(pkglibdir)/rpme
118 @@LN_S@ rpmi $(DESTDIR)$(pkglibdir)/rpme
119 @rm -f $(DESTDIR)$(pkglibdir)/rpmu
120 @@LN_S@ rpmi $(DESTDIR)$(pkglibdir)/rpmu
121 @rm -f $(DESTDIR)$(pkglibdir)/rpmv
122 @@LN_S@ rpmq $(DESTDIR)$(pkglibdir)/rpmv
123 rm -f $(DESTDIR)$(bindir)/rpmbuild
124 @LN_S@ ../lib/rpm/rpmb $(DESTDIR)$(bindir)/rpmbuild
125 rm -f $(DESTDIR)$(bindir)/rpmquery
126 @LN_S@ ../lib/rpm/rpmq $(DESTDIR)$(bindir)/rpmquery
127 rm -f $(DESTDIR)$(bindir)/rpmverify
128 @LN_S@ ../lib/rpm/rpmv $(DESTDIR)$(bindir)/rpmverify
129 rm -f $(DESTDIR)$(bindir)/rpmsign
130 @LN_S@ ../lib/rpm/rpmk $(DESTDIR)$(bindir)/rpmsign
131 rm -f $(DESTDIR)$(bindir)/rpmdb ; \
132 @LN_S@ ../lib/rpm/rpmd $(DESTDIR)$(bindir)/rpmdb ; \
133 for bf in e i u ; do \
134 rm -f $(DESTDIR)$(bindir)/rpm$$bf ; \
135 @LN_S@ ../lib/rpm/rpm$$bf $(DESTDIR)$(bindir)/rpm$$bf ; \
137 @for dir in BUILD RPMS SOURCES SPECS SRPMS ; do\
138 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/$$dir;\
140 @case "@host_cpu@" in \
141 *86) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i386 ;\
142 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i486 ;\
143 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i586 ;\
144 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/i686 ;\
145 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/athlon ;;\
146 alpha*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/alpha ;\
147 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/alphaev6 ;;\
148 arm*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv3l ;\
149 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4l ;\
150 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4tl ;\
151 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv5tel ;\
152 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv5tejl ;\
153 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/armv6l ;;\
154 sparc*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc ;\
155 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv8 ;\
156 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv9 ;\
157 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc64 ;;\
158 ia64*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ia64 ;;\
159 s390*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/s390 ;;\
160 mipsel*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/mipsel ;;\
161 mips*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/mips ;;\
162 powerpc*) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc ;\
163 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppciseries ;\
164 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppcpseries ;\
165 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64 ;\
166 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64iseries ;\
167 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64pseries ;;\
168 *) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/@host_cpu@ ;;\
170 $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/noarch
171 @case "@host_os@" in \
172 mint) $(MKDIR_P) $(DESTDIR)$(pkgsrcdir)/RPMS/m68kmint ;;\
173 solaris*|linux*|darwin*) \
174 chmod u+x $(top_srcdir)/installplatform; DESTDIR="$(DESTDIR)" pkglibdir="$(pkglibdir)" $(top_srcdir)/installplatform rpmrc macros platform ;; \
176 @$(MKDIR_P) $(DESTDIR)$(localstatedir)/tmp
178 # XXX to appease distcheck we need to remove "stuff" here...
180 @rm -rf $(DESTDIR)/$(pkglibdir)/*-*
183 @rm -rf Doxytags apidocs
184 @rm -f stamp-h.in db3/*.orig db3/db3lobjs
189 @for f in $(rpmbin_PROGRAMS) ; do\
190 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(rpmbindir)/$$f ;\
191 $(__CHMOD) g+s $(DESTDIR)$(rpmbindir)/$$f ;\
193 @for f in $(bin_PROGRAMS) ; do\
194 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(bindir)/$$f ;\
196 @for f in $(pkglib_PROGRAMS) ; do\
197 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)/$$f ;\
198 $(__CHMOD) g+s $(DESTDIR)$(pkglibdir)/$$f ;\
200 @for f in $(pkglib_SCRIPTS) ; do\
201 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)/$$f ;\
203 @$(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)
204 @$(__CHOWN) -R ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(rpmvardir)
205 -@$(__CHMOD) 0664 $(DESTDIR)$(rpmvardir)/[A-Z]*
206 -@$(__CHMOD) 0775 $(DESTDIR)$(rpmvardir)
207 -@$(__CHMOD) 0664 $(DESTDIR)$(rpmvardir)/__db.*
211 @for f in $(rpmbin_PROGRAMS) ; do\
212 $(__CHMOD) g-s $(DESTDIR)$(rpmbindir)/$$f ;\
214 @for f in $(pkglib_PROGRAMS) ; do\
215 $(__CHMOD) g-s $(DESTDIR)$(pkglibdir)/$$f ;\
219 doxygen @WITH_APIDOCS_TARGET@: Doxyfile rpmpopt-@VERSION@
222 - [ X"@__DOXYGEN@" != Xno ] && @__DOXYGEN@
231 hg log --no-merge -v > ChangeLog
233 ACLOCAL_AMFLAGS = -I m4