add required files to popt.
[platform/upstream/rpm.git] / Makefile.am
1 # Top level Makefile for rpm
2
3 AUTOMAKE_OPTIONS = 1.3 foreign
4
5 SUBDIRS = popt build lib po intl misc tools scripts
6
7 INCLUDES = -I./build -I./lib -I./intl @INCPATH@
8
9 LDFLAGS = @LDFLAGS_STATIC@ -L./popt -L./build -L./lib -L./misc
10
11 rpmbindir = $(subst usr/bin,bin,$(bindir))
12 rpmbin_PROGRAMS = rpm
13
14 bin_PROGRAMS =          rpm2cpio
15 bin_SCRIPTS =           gendiff
16 noinst_PROGRAMS =       rpmconvert
17
18 man_MANS = rpm.8 rpm2cpio.8
19
20 configdir = @RPMCONFIGDIR@
21 config_DATA = rpmrc rpmpopt macros
22 config_SCRIPTS = find-provides find-requires mkinstalldirs
23
24 noinst_HEADERS = \
25         acconfig.h      build.h         checksig.h      ftp.h   \
26         install.h       query.h         system.h        url.h   \
27         verify.h
28
29 rpm_SOURCES =           build.c checksig.c ftp.c install.c query.c rpm.c url.c \
30                         verify.c
31 rpm_LDADD =             -lrpmbuild -lpopt -lrpm @LIBMISC@
32
33 rpm.o:
34         $(COMPILE) \
35                 -DRPMNLSDIR=\"$(RPMNLSDIR)\" \
36                 -DRPMNLSPACKAGE=\"$(PACKAGE)\" \
37                 -DVERSION=\"$(VERSION)\"  \
38                 -DLIBRPMALIAS_FILENAME=\"$(LIBRPMALIAS_FILENAME)\" \
39                 -DRPMCONFIGDIR="\"$(RPMCONFIGDIR)"\" \
40                 -c rpm.c
41
42 include ./Makefile.inc
43
44 CVSTAG = r$(subst .,-,$(VERSION))
45
46 rpm2cpio_SOURCES =      rpm2cpio.c
47 rpm2cpio_LDADD =        -lrpmbuild -lpopt -lrpm
48
49 rpmconvert_SOURCES =    convertdb.c oldrpmdb.c
50 rpmconvert_LDADD =      -lrpmbuild -lpopt -lrpm -lgdbm
51
52 install-data-local:
53         ln -s rpm/rpmrc $(libdir)/rpmrc
54         ln -s rpm/rpmpopt $(libdir)/rpmpopt
55
56 # FIXME: these should be generated in configure.in
57 find-requires: find-requires.sh
58         cp $< $@
59 find-provides: find-provides.sh
60         cp $< $@
61 rpmrc: lib-rpmrc
62         cp $< $@
63
64 # FIXME: these should be checked
65 .PHONY:                tar
66 tar:
67         rm -rf /tmp/rpm-$(VERSION)
68         make installprefix=/tmp/rpm-$(VERSION)$(ROOT) install
69         $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/SOURCES
70         $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/SPECS
71         $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/SRPMS
72         $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/RPMS
73         $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/BUILD
74         $(mkinstalldirs) /tmp/rpm-$(VERSION)/var/local/lib/rpm
75         $(mkinstalldirs) /tmp/rpm-$(VERSION)/var/tmp
76 #       Couldn't figure de ARCH value   
77 #       $(mkinstalldirs) /tmp/rpm-$(VERSION)/usr/local/src/redhat/RPMS/i386
78         cd /tmp/rpm-$(VERSION) ; tar cvf /tmp/rpm-$(VERSION).tar .
79
80 .PHONY: noconfig
81 noconfig:
82         find . -name "Makefile" -exec rm {} \; 
83         rm -f *gz *rpm config.*
84
85 .PHONY: archive
86 archive: 
87         @echo " "
88         @echo "I hope you checked everything out and made sure it builds"
89         @echo "maybe someday Erik will get around to making that automatic."
90         @echo
91         @echo "This is version $(VERSION)."
92         @sleep 5
93         @cvs -Q tag -F $(CVSTAG) .
94         @rm -rf /tmp/rpm-$(VERSION) /tmp/rpm
95         @cd /tmp; cvs -Q -d $(CVSROOT) export -r$(CVSTAG) rpm || :
96         @mv /tmp/rpm /tmp/rpm-$(VERSION)
97         @rm /tmp/rpm-$(VERSION)/popt/popt.spec
98         @cd /tmp/rpm-$(VERSION); ./autogen.sh ; make depend; make distclean
99         @cd /tmp/rpm-$(VERSION); ./autogen.sh --noconfigure
100         @cd /tmp; tar czSpf rpm-$(VERSION).tar.gz rpm-$(VERSION)
101         @rm -rf /tmp/rpm-$(VERSION)
102         @cp /tmp/rpm-$(VERSION).tar.gz .
103         @rm -f /tmp/rpm-$(VERSION).tar.gz 
104         @echo " "
105         @echo "The final archive is ./rpm-$(VERSION).tar.gz."