File: Makefile.RPM.openldap2

package info (click to toggle)
libnss-ldap 122-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 680 kB
  • ctags: 819
  • sloc: ansic: 8,324; perl: 89; makefile: 34
file content (119 lines) | stat: -rw-r--r-- 3,116 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# Makefile for Linux nss_ldap

# For building of RPM Package
# Tested with RedHat 5.2/6.0

# Copyright (C) 1997 Luke Howard.
# This file is part of the nss_ldap Library.

# The nss_ldap library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.

# The nss_ldap Library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Library General Public License for more details.

# You should have received a copy of the GNU Library General Public
# License along with the nss_ldap Library; see the file COPYING.LIB.  If not,
# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.

#
# $Id: Makefile.RPM.openldap2,v 2.1 2000/10/11 22:51:45 lukeh Exp $
#

MODULE=nss_ldap
HDRS=	\
	ldap-alias.h \
	ldap-ethers.h \
	ldap-grp.h \
	ldap-hosts.h \
	ldap-netgrp.h \
	ldap-network.h \
	ldap-nss.h \
	ldap-proto.h \
	ldap-pwd.h \
	ldap-rpc.h \
	ldap-service.h \
	ldap-spwd.h \
	util.h \
	globals.h \
	ltf.h \
	irs-nss.h \
	ldap-parse.h \
	snprintf.h \
	resolve.h \
	dnsconfig.h

SRCS=	ldap-nss.c \
	ldap-pwd.c \
	ldap-grp.c \
	ldap-rpc.c \
	ldap-hosts.c \
	ldap-network.c \
	ldap-proto.c \
	ldap-spwd.c \
	ldap-alias.c \
	ldap-service.c \
	ldap-ethers.c \
	ldap-bp.c \
	util.c \
	globals.c \
	ltf.c \
	snprintf.c \
	resolve.c \
	dnsconfig.c

OBJS=$(SRCS:.c=.o)

# uncomment NSFLAGS if you are using the Netscape SDK
NSFLAGS=-I/usr/local/include -DLDAP_VERSION3_API -DRFC2307BIS 

# uncomment GNUFLAGS if you are building a GNU glibc-2.x module
GNUFLAGS=-DGNU_NSS -DHAVE_SNPRINTF -D_REENTRANT #-DLDAP_VERSION3_API
LIBCVERS= `ls /lib/libc-*.so |sed -e 's/\/lib\/libc-\(.*\)\.so/\1/'`
NSSLIBVER=$(shell ls /lib/libnss_files.so.? | tail -1 | sed -e 's/\/lib\/libnss_files\.so\.\(.*\)/\1/')

SOLIB=lib$(MODULE).so.$(NSSLIBVER)
NSSLIB=lib$(MODULE)-$(LIBCVERS).so

LIBDIRS=-L.

# uncomment this if you're linking against Sun or Netscape's libldap.so
# or using UMich libldap/liblber compiled into one library
#
# This is a hack
LIBS=-lnsl -lresolv /usr/lib/libldap.a /usr/lib/liblber.a -lsasl -lpthread 

# uncomment this if you're using gcc
GCCFLAGS=-O -g -Wall -fPIC
DEBUGFLAGS=

CC=gcc
COMPILERFLAGS=$(GCCFLAGS)

LD=gcc
GNULDFLAGS=-shared -Wl,-soname,$(SOLIB)
LDFLAGS=$(GNULDFLAGS)

CFLAGS=-DLDAP_REFERRALS $(DEBUGFLAGS) $(NSFLAGS) $(SUNFLAGS) $(BSDFLAGS) $(GNUFLAGS) $(COMPILERFLAGS) $(INCDIRS)

all: $(MODULE)

$(MODULE): $(OBJS)
	$(LD) $(LIBDIRS) $(LDFLAGS) -o $(NSSLIB) $(OBJS) $(LIBS)

install:
	@mkdir -p $(RPM_BUILD_ROOT)/lib $(RPM_BUILD_ROOT)/etc $(RPM_BUILD_ROOT)/usr/lib
	install -m 644 $(NSSLIB) $(RPM_BUILD_ROOT)/lib/$(NSSLIB)
	ln -sf $(NSSLIB) $(RPM_BUILD_ROOT)/lib/lib$(MODULE).so.1
	ln -sf $(NSSLIB) $(RPM_BUILD_ROOT)/lib/lib$(MODULE).so.2	
	ln -sf ../../lib/$(NSSLIB) $(RPM_BUILD_ROOT)/usr/lib/$(MODULE).so

clean:
	rm -f $(OBJS) $(NSSLIB) core