# # Makefile for openldap Slackware package # Copyright (c) 2004 by Robert Stan # PROGNAME = openldap VERSION = 2.2.16 ARCH = i486 BUILD = 1rob SOURCE = ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/openldap-$(VERSION).tgz DOCS = ANNOUNCEMENT CHANGES COPY* INSTALL LICENSE README doc/devel CUSTNAME = openldap-client PKGNAME = $(CUSTNAME)-$(VERSION)-$(ARCH)-$(BUILD) MAINTAINER = Robert Stan CFLAGS = "-O2 -pipe -march=$(ARCH) -mcpu=i686" CXXFLAGS = $(CFLAGS) STRIPLIB = y STRIPBIN = y TMP = /var/tmp PKG = $(TMP)/package-$(PROGNAME)-$(VERSION) # prepare build myprep: if [ -d $(PKG) ]; then cd $(TMP); rm -rf package-$(PROGNAME)-$(VERSION); fi mkdir -p $(PKG)/install if [ ! -r $(PROGNAME)-$(VERSION).tar.gz -a ! -r $(PROGNAME)-$(VERSION).tgz ]; \ then wget $(SOURCE); fi if [ -r $(PROGNAME)-$(VERSION).tgz ]; then \ mv $(PROGNAME)-$(VERSION).tgz $(PROGNAME)-$(VERSION).tar.gz; \ tar xvzf $(PROGNAME)-$(VERSION).tar.gz; \ elif [ -r $(PROGNAME)-$(VERSION).tar.gz ]; then \ tar xvzf $(PROGNAME)-$(VERSION).tar.gz; \ else \ echo "No source tarball available !"; \ exit 1; \ fi conf: myprep cd $(PROGNAME)-$(VERSION); \ CFLAGS=$(CFLAGS) CXXFLAGS=$(CXXFLAGS) \ ./configure --prefix=/usr \ --sysconfdir=/etc \ --disable-slapd \ --disable-slurpd build: conf CFLAGS=$(CFLAGS) CXXFLAGS=$(CXXFLAGS) \ make -j4 -C $(PROGNAME)-$(VERSION) package: build mkdir -p $(PKG)/usr/doc/$(PROGNAME)-$(VERSION) cd $(PROGNAME)-$(VERSION); \ cp -a $(DOCS) $(PKG)/usr/doc/$(PROGNAME)-$(VERSION); \ make DESTDIR=$(PKG) install rm $(PKG)/etc/openldap/ldap.conf cat slack-desc > ../$(PKGNAME).txt cat slack-desc > $(PKG)/install/slack-desc cat slack-required > $(PKG)/install/slack-required STRIPLIB=$(STRIPLIB) STRIPBIN=$(STRIPBIN) ../../preparepkg $(PKG) cat doinst.sh >> $(PKG)/install/doinst.sh cd $(PKG) ; makepkg -l y -c n $(PKGNAME).tgz mv $(PKG)/$(PKGNAME).tgz .. include ../../Makefile.global