| 
									
										
										
										
											2005-12-08 20:35:34 +00:00
										 |  |  | # $Id$ 
 | 
					
						
							| 
									
										
										
										
											2006-10-05 22:14:45 +00:00
										 |  |  | VERSION=0.4.1 | 
					
						
							| 
									
										
										
										
											2006-06-17 19:57:07 +00:00
										 |  |  | RELEASE=0 | 
					
						
							| 
									
										
										
										
											2006-06-12 21:43:55 +00:00
										 |  |  | CC=gcc | 
					
						
							|  |  |  | DEBUG_CFLAGS=-g -ggdb | 
					
						
							|  |  |  | CFLAGS=-O2 | 
					
						
							| 
									
										
										
										
											2005-12-02 04:21:08 +00:00
										 |  |  | LIBS=-lldap -llber | 
					
						
							| 
									
										
										
										
											2005-12-02 04:09:15 +00:00
										 |  |  | LD=gcc  | 
					
						
							|  |  |  | LDFLAGS= | 
					
						
							|  |  |  | INSTALL_PREFIX= | 
					
						
							|  |  |  | PREFIXDIR=$(INSTALL_PREFIX)/usr | 
					
						
							|  |  |  | LDAPCONFDIR=$(INSTALL_PREFIX)/etc/openldap | 
					
						
							|  |  |  | SPECFILE=ldap2dns.spec | 
					
						
							| 
									
										
										
										
											2005-12-05 03:19:12 +00:00
										 |  |  | DISTRIBUTION=redhat | 
					
						
							| 
									
										
										
										
											2005-12-02 04:09:15 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-12-05 03:32:56 +00:00
										 |  |  | ifeq "$(DISTRIBUTION)" "redhat" | 
					
						
							|  |  |  | RPMBASE=/usr/src/redhat | 
					
						
							|  |  |  | RPMGROUP=Daemons/DNS | 
					
						
							|  |  |  | OPENLDAPPKG=openldap | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ifeq "$(DISTRIBUTION)" "suse" | 
					
						
							|  |  |  | RPMBASE=/usr/src/packages | 
					
						
							|  |  |  | RPMGROUP=Productivity/Networking/DNS/Servers | 
					
						
							|  |  |  | OPENLDAPPKG=openldap2 | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-12-05 02:39:30 +00:00
										 |  |  | all: ldap2dns ldap2dnsd | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | debug: ldap2dns-dbg | 
					
						
							| 
									
										
										
										
											2005-12-02 04:09:15 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-06-08 16:18:50 +00:00
										 |  |  | ldap2dns: ldap2dns.o | 
					
						
							|  |  |  | 	$(LD) $(LDFLAGS) $(LIBS) -o $@ $+ | 
					
						
							| 
									
										
										
										
											2005-12-02 04:26:14 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | ldap2dnsd: ldap2dns | 
					
						
							| 
									
										
										
										
											2005-12-02 04:09:15 +00:00
										 |  |  | 	ln -f ldap2dns ldap2dnsd | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-06-08 16:48:46 +00:00
										 |  |  | ldap2dns-dbg: ldap2dns.o-dbg | 
					
						
							|  |  |  | 	$(LD) $(LDFLAGS) $(LIBS) -o $@ $+ | 
					
						
							| 
									
										
										
										
											2005-12-02 04:26:14 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-12-02 04:09:15 +00:00
										 |  |  | ldap2dns.o: ldap2dns.c | 
					
						
							| 
									
										
										
										
											2006-06-12 21:43:55 +00:00
										 |  |  | 	$(CC) $(CFLAGS) -DVERSION='"$(VERSION)"' -c $< -o $@ | 
					
						
							| 
									
										
										
										
											2005-12-02 04:26:14 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | ldap2dns.o-dbg: ldap2dns.c | 
					
						
							| 
									
										
										
										
											2006-06-12 21:43:55 +00:00
										 |  |  | 	$(CC) $(DEBUG_CFLAGS) $(CFLAGS) -DVERSION='"$(VERSION)"' -c $< -o $@ | 
					
						
							| 
									
										
										
										
											2005-12-02 04:09:15 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | install: all | 
					
						
							|  |  |  | 	mkdir -p $(PREFIXDIR)/bin | 
					
						
							| 
									
										
										
										
											2005-12-02 04:26:14 +00:00
										 |  |  | 	mkdir -p $(LDAPCONFDIR)/schema | 
					
						
							| 
									
										
										
										
											2006-06-13 16:51:59 +00:00
										 |  |  | 	install -s -m 755 ldap2dns $(PREFIXDIR)/bin/ | 
					
						
							| 
									
										
										
										
											2005-12-02 04:09:15 +00:00
										 |  |  | 	ln -f $(PREFIXDIR)/bin/ldap2dns $(PREFIXDIR)/bin/ldap2dnsd | 
					
						
							| 
									
										
										
										
											2006-06-13 16:51:59 +00:00
										 |  |  | 	install -m 755 ldap2tinydns-conf $(PREFIXDIR)/bin/ | 
					
						
							|  |  |  | 	install -m 644 ldap2dns.schema $(LDAPCONFDIR)/schema/ | 
					
						
							| 
									
										
										
										
											2005-12-02 04:09:15 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | clean: | 
					
						
							| 
									
										
										
										
											2005-12-22 20:35:09 +00:00
										 |  |  | 	rm -f *.o *.o-dbg ldap2dns ldap2dns-dbg ldap2dnsd data* *.db core \
 | 
					
						
							|  |  |  |     $(SPECFILE) | 
					
						
							| 
									
										
										
										
											2005-12-02 04:09:15 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | tar: clean | 
					
						
							|  |  |  | 	cd ..; \
 | 
					
						
							| 
									
										
										
										
											2005-12-05 02:39:30 +00:00
										 |  |  | 	mv ldap2dns ldap2dns-$(VERSION); \
 | 
					
						
							|  |  |  | 	tar --exclude .svn -czf ldap2dns-$(VERSION).tar.gz ldap2dns-$(VERSION); \
 | 
					
						
							|  |  |  | 	mv ldap2dns-$(VERSION) ldap2dns; \
 | 
					
						
							|  |  |  | 	cd ldap2dns | 
					
						
							| 
									
										
										
										
											2005-12-02 04:09:15 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-12-05 03:19:12 +00:00
										 |  |  | rpm: tar | 
					
						
							|  |  |  | 	sed -e 's#%VERSION%#$(VERSION)#g' \
 | 
					
						
							|  |  |  | 	    -e 's#%RELEASE%#$(RELEASE)#g' \
 | 
					
						
							|  |  |  | 		-e 's#%RPMGROUP%#$(RPMGROUP)#g' \
 | 
					
						
							| 
									
										
										
										
											2005-12-05 03:32:56 +00:00
										 |  |  | 		-e 's#%OPENLDAPPKG%#$(OPENLDAPPKG)#g' \
 | 
					
						
							| 
									
										
										
										
											2005-12-05 03:19:12 +00:00
										 |  |  | 	    < $(SPECFILE).in > $(SPECFILE) | 
					
						
							|  |  |  | 		 | 
					
						
							| 
									
										
										
										
											2005-12-05 03:32:56 +00:00
										 |  |  | 	mv ../ldap2dns-$(VERSION).tar.gz $(RPMBASE)/SOURCES | 
					
						
							| 
									
										
										
										
											2005-12-05 03:19:12 +00:00
										 |  |  | 	rpmbuild -ba $(SPECFILE) |