diff --git a/Makefile b/Makefile index 55abf4f..0758083 100644 --- a/Makefile +++ b/Makefile @@ -11,9 +11,7 @@ INSTALL_PREFIX= PREFIXDIR=$(INSTALL_PREFIX)/usr LDAPCONFDIR=$(INSTALL_PREFIX)/etc/openldap SPECFILE=ldap2dns.spec -RPMSRCDIR=/usr/src/packages/SOURCES -# For Red Hat use -# make RPMSRCDIR=/usr/src/redhat/SOURCES rpm +DISTRIBUTION=redhat all: ldap2dns ldap2dnsd @@ -52,13 +50,22 @@ tar: clean mv ldap2dns-$(VERSION) ldap2dns; \ cd ldap2dns -$(SPECFILE): Specfile +rpm: tar +ifeq "$(DISTRIBUTION)" "redhat" + RPMBASE=/usr/src/redhat + RPMGROUP=Daemons/DNS +endif + +ifeq "$(DISTRIBUTION)" "suse" + RPMBASE=/usr/src/packages + RPMGROUP=Productivity/Networking/DNS/Servers +endif + + sed -e 's#%VERSION%#$(VERSION)#g' \ -e 's#%RELEASE%#$(RELEASE)#g' \ - < $< > $@ - -rpm: tar $(SPECFILE) - mv ../ldap2dns-$(VERSION).tar.gz $(RPMSRCDIR) + -e 's#%RPMGROUP%#$(RPMGROUP)#g' \ + < $(SPECFILE).in > $(SPECFILE) + + mv ../ldap2dns-$(VERSION).tar.gz $(RPMBASE) rpmbuild -ba $(SPECFILE) - - diff --git a/Specfile b/Specfile index 0b9d8c0..f1afb7d 100644 --- a/Specfile +++ b/Specfile @@ -1,12 +1,27 @@ -Summary: LDAP to DNS gateway. -Name: ldap2dns -Version: %VERSION% -Release: %RELEASE% -Copyright: GPL -Group: Daemons/DNS -Source: ldap2dns-%{version}.tar.gz -BuildRoot: /var/tmp/%{name}-root -Requires: openldap-devel +# +# spec file for package ldap2dns +# +# Copyright (c) 2005 Ben Klang, Alkaloid Networks +# This file and all modifications and additions to the pristine +# package are under the same license as the package itself. +# +# Please submit bugfixes or comments via http://projects.alkaloid.net +# + +# norootforbuild +# neededforbuild openldap-devel +BuildRequires: openldap-devel + +Summary: LDAP to DNS gateway +Packager: Ben Klang +Vendor: Alkaloid Networks +Name: ldap2dns +Version: %VERSION% +Release: %RELEASE% +License: GPL +Group: %RPMGROUP% +Source: ldap2dns-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-build %description ldap2dns is a program to create DNS records directly from an LDAP database. It @@ -17,8 +32,9 @@ administrator only has to access the LDAP database. If he desires he can add access control for each zone, create a webbased GUI and add all other kind of zone and resource record information without interfering with the DNS server. -ldap2dns is designed to write binary data.cdb files used by tinydns, but also -may be used to write .db-files used by named. + +ldap2dns is designed to write the text data files used by tinydns, but also +may be used to write zone files used by Bind. %prep %setup @@ -38,7 +54,8 @@ make INSTALL_PREFIX=$RPM_BUILD_ROOT install /usr/bin/ldap2dns /usr/bin/ldap2dnsd /usr/bin/ldap2tinydns-conf -%doc README.html +%doc doc/README.html +%doc doc/example.ldif %doc import.pl %config /etc/openldap/schema/ldap2dns.schema