# # Makefile for NET-SNMP Slackware package # Copyright (c) 2004 by Robert Stan # PROGNAME = net-snmp VERSION = 5.1.1 ARCH = i486 BUILD = 1rob SOURCE = http://dl.sf.net/net-snmp/net-snmp-$(VERSION).tar.gz DOCS = AGENT.txt COPYING ChangeLog FAQ INSTALL NEWS \ README README.agentx README.snmpv3 README.thread TODO CUSTNAME = $(PROGNAME) 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) conf: prep cd $(PROGNAME)-$(VERSION); \ chown -R root:root .; \ ./configure --prefix=/usr \ --datadir=/etc \ --localstatedir=/var \ --enable-shared \ --enable-static \ --with-libwrap \ --with-defaults \ --with-perl-modules \ --without-rpm \ --disable-debugging \ --with-cflags=$(CFLAGS) \ --with-mib-modules=host build: conf make -j1 -C $(PROGNAME)-$(VERSION) package: build mkdir -p $(PKG)/usr/doc/$(PROGNAME)-$(VERSION) cd $(PROGNAME)-$(VERSION); \ cp -a $(DOCS) $(PKG)/usr/doc/$(PROGNAME)-$(VERSION); \ make prefix=$(PKG)/usr \ datadir=$(PKG)/etc \ bindir=$(PKG)/usr/bin \ sbindir=$(PKG)/usr/sbin \ libdir=$(PKG)/usr/lib \ mandir=$(PKG)/usr/man \ install cd $(PROGNAME)-$(VERSION)/perl; \ make DESTDIR=$(PKG) install cd $(PROGNAME)-$(VERSION); \ cp -a EXAMPLE.conf $(PKG)/etc/snmp/snmpd.conf.example1 mkdir -p $(PKG)/etc/rc.d/ $(PKG)/var/{net-snmp,log} cp -a rc.snmpd $(PKG)/etc/rc.d chown root.root $(PKG)/etc/rc.d/rc.snmpd chmod 755 $(PKG)/etc/rc.d/rc.snmpd cp -a snmpd.conf.example2 $(PKG)/etc/snmp/snmpd.conf.example2 find $(PKG)/etc/snmp -type f -exec chmod 644 {} \; 1>/dev/null 2>/dev/null find $(PKG)/etc/snmp -type d -exec chmod 755 {} \; 1>/dev/null 2>/dev/null rm -f $(PKG)/usr/include/net-snmp/library/README cat slack-desc > ../$(PKGNAME).txt cat slack-desc > $(PKG)/install/slack-desc cat doinst.sh >> $(PKG)/install/doinst.sh cat slack-required > $(PKG)/install/slack-required STRIPLIB=$(STRIPLIB) STRIPBIN=$(STRIPBIN) ../../preparepkg $(PKG) cd $(PKG) ; makepkg -l y -c n $(PKGNAME).tgz mv $(PKG)/$(PKGNAME).tgz .. include ../../Makefile.global