1 # Top level Makefile for rpm
3 AUTOMAKE_OPTIONS = 1.4 foreign
5 EXTRA_DIST = CHANGES CREDITS Doxyheader GROUPS README.amiga INSTALL \
6 RPM-GPG-KEY RPM-PGP-KEY \
7 autodeps/none autodeps/*.prov autodeps/*.req autogen.sh \
8 config.site db db3/configure gendiff installplatform platform* \
9 Perl-RPM po/*.in po/*.po po/rpm.pot \
10 rpm.magic rpmpopt-$(VERSION) rpmqv.c rpm.c
12 SUBDIRS = intl po @WITH_ZLIB_SUBDIR@ @WITH_DB_SUBDIR@ popt beecrypt rpmio rpmdb lib build misc @WITH_PYTHON_SUBDIR@ tools scripts tests doc .
15 -I$(top_srcdir)/build \
17 -I$(top_srcdir)/rpmdb \
18 -I$(top_srcdir)/rpmio \
19 -I$(top_srcdir)/beecrypt \
20 -I$(top_srcdir)/popt \
26 myLDFLAGS = @LDFLAGS_STATIC@
28 # XXX libtool can/should generate dependent libs.
29 # XXX solaris2.6 cannot use *.la with --all-static (downrev binutils/egcs?)
30 # XXX top_builddir ldpaths are wrong building in tree
32 $(top_builddir)/build/librpmbuild.la \
33 $(top_builddir)/lib/librpm.la \
34 $(top_builddir)/rpmdb/librpmdb.la \
35 $(top_builddir)/rpmio/librpmio.la \
36 $(top_builddir)/popt/libpopt.la \
40 rpmbindir = `echo $(bindir) | sed -e s,usr/bin,bin,`
43 bin_PROGRAMS = rpm2cpio
46 pkglibdir = @RPMCONFIGDIR@
47 pkglib_PROGRAMS = rpmb rpmd rpmi rpmk rpmq
48 pkglib_DATA = rpmrc rpmpopt-$(VERSION) macros
49 pkglib_SCRIPTS = find-provides find-requires mkinstalldirs \
50 config.guess config.sub config.site
52 rpmpopt-$(VERSION): rpmpopt
56 acconfig.h build.h debug.h system.h
59 rpm_LDFLAGS = @LDFLAGS_STATIC@ $(myLDFLAGS)
60 rpm_LDADD = rpm.o $(myLDADD)
62 $(COMPILE) -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV -o $@ -c rpmqv.c
65 #rpm_LDFLAGS = @LDFLAGS_STATIC@ $(myLDFLAGS)
66 #rpm_LDADD = $(myLDADD)
68 rpmb_SOURCES = build.c
69 rpmb_LDFLAGS = $(myLDFLAGS)
70 rpmb_LDADD = rpmb.o $(myLDADD)
72 $(COMPILE) -DIAM_RPMBT -o $@ -c rpmqv.c
75 rpmd_LDFLAGS = $(myLDFLAGS)
76 rpmd_LDADD = rpmd.o $(myLDADD)
78 $(COMPILE) -DIAM_RPMDB -o $@ -c rpmqv.c
81 rpmi_LDFLAGS = $(myLDFLAGS)
82 rpmi_LDADD = rpmi.o $(myLDADD)
84 $(COMPILE) -DIAM_RPMEIU -o $@ -c rpmqv.c
87 rpmk_LDFLAGS = $(myLDFLAGS)
88 rpmk_LDADD = rpmk.o $(myLDADD)
90 $(COMPILE) -DIAM_RPMK -o $@ -c rpmqv.c
93 rpmq_LDFLAGS = $(myLDFLAGS)
94 rpmq_LDADD = rpmq.o $(myLDADD)
96 $(COMPILE) -DIAM_RPMQV -o $@ -c rpmqv.c
98 rpm2cpio_SOURCES = rpm2cpio.c
99 rpm2cpio_LDFLAGS = $(myLDFLAGS)
100 rpm2cpio_LDADD = $(myLDADD) @LIBMISC@
102 $(PROGRAMS): $(myLDADD) @WITH_APIDOCS_TARGET@
106 lclint $(DEFS) $(INCLUDES) rpmqv.c $(rpmb_SOURCES) \
107 `make -s sources -C build` \
108 `make -s sources -C lib` \
109 `make -s sources -C rpmdb` \
110 `make -s sources -C rpmio` \
111 `make -s sources -C beecrypt` \
112 `make -s sources -C popt`
114 CVSTAG = r$(subst .,-,$(VERSION))
116 pkgsrcdir = $(prefix)/src/$(RPMCANONVENDOR)
119 @$(mkinstalldirs) $(DESTDIR)$(varprefix)/lib/rpm
120 @rm -f $(DESTDIR)$(libdir)/rpmrc
121 @@LN_S@ rpm/rpmrc $(DESTDIR)$(libdir)/rpmrc
122 @rm -f $(DESTDIR)$(libdir)/rpmpopt
123 @@LN_S@ rpm/rpmpopt $(DESTDIR)$(libdir)/rpmpopt
124 @rm -f $(DESTDIR)$(libdir)/rpm/rpmt
125 @@LN_S@ rpmb $(DESTDIR)$(libdir)/rpm/rpmt
126 @rm -f $(DESTDIR)$(libdir)/rpm/rpme
127 @@LN_S@ rpmi $(DESTDIR)$(libdir)/rpm/rpme
128 @rm -f $(DESTDIR)$(libdir)/rpm/rpmu
129 @@LN_S@ rpmi $(DESTDIR)$(libdir)/rpm/rpmu
130 @rm -f $(DESTDIR)$(libdir)/rpm/rpmv
131 @@LN_S@ rpmq $(DESTDIR)$(libdir)/rpm/rpmv
132 rm -f $(DESTDIR)$(bindir)/rpmbuild
133 @LN_S@ ../lib/rpm/rpmb $(DESTDIR)$(bindir)/rpmbuild
134 rm -f $(DESTDIR)$(bindir)/rpmquery
135 @LN_S@ ../lib/rpm/rpmq $(DESTDIR)$(bindir)/rpmquery
136 rm -f $(DESTDIR)$(bindir)/rpmverify
137 @LN_S@ ../lib/rpm/rpmv $(DESTDIR)$(bindir)/rpmverify
138 rm -f $(DESTDIR)$(bindir)/rpmsign
139 @LN_S@ ../lib/rpm/rpmk $(DESTDIR)$(bindir)/rpmsign
140 rm -f $(DESTDIR)$(bindir)/rpmdb ; \
141 @LN_S@ ../lib/rpm/rpmd $(DESTDIR)$(bindir)/rpmdb ; \
142 for bf in e i u ; do \
143 rm -f $(DESTDIR)$(bindir)/rpm$$bf ; \
144 @LN_S@ ../lib/rpm/rpm$$bf $(DESTDIR)$(bindir)/rpm$$bf ; \
146 @for dir in BUILD RPMS SOURCES SPECS SRPMS ; do\
147 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/$$dir;\
149 @case "@host_cpu@" in \
150 *86) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/i386 ;\
151 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/i486 ;\
152 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/i586 ;\
153 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/i686 ;\
154 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/athlon ;;\
155 alpha*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/alpha ;\
156 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/alphaev6 ;;\
157 sparc*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc ;\
158 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv9 ;\
159 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc64 ;;\
160 ia64*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/ia64 ;;\
161 s390*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/s390 ;;\
162 mipsel*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/mipsel ;;\
163 mips*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/mips ;;\
164 powerpc*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc ;\
165 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/ppc64 ;;\
166 *) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/@host_cpu@ ;;\
168 $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/noarch
169 @case "@host_os@" in \
170 mint) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/m68kmint ;;\
172 chmod u+x ./installplatform; DESTDIR="$(DESTDIR)" pkglibdir="$(pkglibdir)" ./installplatform rpmrc macros platform ;; \
174 @$(mkinstalldirs) $(DESTDIR)/var/tmp
178 @for f in $(rpmbin_PROGRAMS) ; do\
179 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(rpmbindir)/$$f ;\
180 $(__CHMOD) g+s $(DESTDIR)$(rpmbindir)/$$f ;\
182 @for f in $(bin_PROGRAMS) ; do\
183 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(bindir)/$$f ;\
185 @for f in $(pkglib_PROGRAMS) ; do\
186 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)/$$f ;\
187 $(__CHMOD) g+s $(DESTDIR)$(pkglibdir)/$$f ;\
189 @for f in $(pkglib_SCRIPTS) ; do\
190 $(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)/$$f ;\
192 @$(__CHOWN) ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(pkglibdir)
193 @$(__CHOWN) -R ${RPMUSER}.${RPMGROUP} $(DESTDIR)$(varprefix)/lib/rpm
194 -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/rpm/[A-Z]*
195 -@$(__CHMOD) 0775 $(DESTDIR)$(varprefix)/lib/rpm
196 -@$(__CHMOD) 0664 $(DESTDIR)$(varprefix)/lib/rpm/__db.*
200 @for f in $(rpmbin_PROGRAMS) ; do\
201 $(__CHMOD) g-s $(DESTDIR)$(rpmbindir)/$$f ;\
203 @for f in $(pkglib_PROGRAMS) ; do\
204 $(__CHMOD) g-s $(DESTDIR)$(pkglibdir)/$$f ;\
209 rm -rf /tmp/rpm-$(VERSION)
210 $(MAKE) DESTDIR=/tmp/rpm-$(VERSION) install
211 cd /tmp/rpm-$(VERSION) ; tar cvf /tmp/rpm-$(VERSION).tar .
215 find . -name "Makefile" -exec rm {} \;
216 rm -f *gz *rpm config.*
220 @cvs -d `cat CVS/Root` diff 2>&1 > /dev/null || { \
222 echo "==> Please resolve differences between the repository and" ; \
223 echo "==> your rpm check out before tagging." ; \
229 @cvs -d `cat CVS/Root` -Q tag -F $(CVSTAG) .
232 @echo "The final archive is ./rpm-$(VERSION).tar.gz."
235 nextsrpm: all archive
236 @sudo ./rpm -ta rpm-$(VERSION).tar.gz
239 doxygen @WITH_APIDOCS_TARGET@: Doxyfile
242 - [ X"@__DOXYGEN@" != Xno ] && @__DOXYGEN@
245 find . -type f -name "*.[ch]*" | xargs @CTAGS@