- Rename Makefile.dist to Makefile.libdhcp4client
- Spec file cleanups - Include stdarg.h in libdhcp_control.h
This commit is contained in:
parent
6e55b2e94c
commit
1f3c4d3c46
131
Makefile.dist
131
Makefile.dist
@ -1,131 +0,0 @@
|
||||
# Makefile.dist for libdhcp4client
|
||||
#
|
||||
# We get the libdhcp4client library from the patched ISC source code. We
|
||||
# rebuild key C files with -DLIBDHCP to turn on the library features we
|
||||
# need. Normal build results in standard ISC code (i.e., not LIBDHCP
|
||||
# stuff enabled). We then link together a static library and a shared
|
||||
# library with the new resulting objects.
|
||||
#
|
||||
# David Cantrell <dcantrell@redhat.com>
|
||||
|
||||
# What version of ISC DHCP is this?
|
||||
VER = $(shell grep DHCP_VERSION ../../includes/version.h | head -1 | cut -d '"' -f 2 | cut -d 'V' -f 2 | cut -d '-' -f 1)
|
||||
|
||||
PROGS = libdhcp4client.a libdhcp4client-$(VER).so.0
|
||||
|
||||
# NOTE: The ordering of these file lists is important! We are using the
|
||||
# whole program optimization features of gcc, so the order matters here.
|
||||
|
||||
# Source files shared by all objects
|
||||
COMMON_SRCS = client_clparse.c client_dhclient.c common_alloc.c common_bpf.c \
|
||||
common_comapi.c common_conflex.c common_discover.c \
|
||||
common_dispatch.c common_dns.c common_ethernet.c \
|
||||
common_execute.c common_inet.c common_lpf.c common_memory.c \
|
||||
common_options.c common_packet.c common_parse.c common_print.c \
|
||||
common_socket.c common_tables.c common_tr.c common_tree.c \
|
||||
dst_dst_api.c dst_base64.c dst_hmac_link.c dst_md5_dgst.c \
|
||||
omapip_alloc.c omapip_array.c omapip_auth.c omapip_buffer.c \
|
||||
omapip_connection.c omapip_convert.c omapip_dispatch.c \
|
||||
omapip_errwarn.c omapip_handle.c omapip_hash.c \
|
||||
omapip_listener.c omapip_mrtrace.c omapip_result.c \
|
||||
omapip_support.c omapip_toisc.c omapip_trace.c
|
||||
|
||||
# Source files for libdhcp4client.o
|
||||
CLIENT_SRCS = common_ctrace.c common_dlpi.c common_nit.c common_upf.c \
|
||||
dst_dst_support.c dst_prandom.c omapip_generic.c \
|
||||
omapip_message.c omapip_protocol.c
|
||||
|
||||
# Source files for libres.o (minires)
|
||||
MINIRES_SRCS = minires_ns_date.c minires_ns_name.c minires_ns_parse.c \
|
||||
minires_ns_samedomain.c minires_ns_sign.c minires_ns_verify.c \
|
||||
minires_res_comp.c minires_res_findzonecut.c \
|
||||
minires_res_init.c minires_res_mkquery.c \
|
||||
minires_res_mkupdate.c minires_res_query.c minires_res_send.c \
|
||||
minires_res_sendsigned.c minires_res_update.c
|
||||
|
||||
# ISC dhcp headers we need to copy to /usr/include/dhcp4client
|
||||
DHCP_HEADERS = dhcpd.h cdefs.h osdep.h arpa/nameser.h minires/minires.h \
|
||||
site.h cf/linux.h dhcp.h statement.h tree.h inet.h dhctoken.h \
|
||||
omapip/omapip_p.h failover.h ctrace.h minires/resolv.h \
|
||||
minires/res_update.h omapip/convert.h omapip/hash.h \
|
||||
omapip/trace.h
|
||||
|
||||
HDRS = dhcp4client.h
|
||||
SRCS = $(COMMON_SRCS) $(CLIENT_SRCS)
|
||||
OBJS = $(SRCS:.c=.o)
|
||||
|
||||
INCLUDES = -I$(TOP) -I$(TOP)/includes -I$(TOP)/dst -I.
|
||||
CFLAGS = $(DEBUG) $(PREDEFINES) $(INCLUDES) $(COPTS) \
|
||||
-DCLIENT_PATH=${CLIENT_PATH} -DLIBDHCP -DUSE_MD5
|
||||
|
||||
all: $(PROGS)
|
||||
|
||||
install: all
|
||||
install -p -m 0755 -D libdhcp4client-$(VER).so.0 $(DESTDIR)$(LIBDIR)/libdhcp4client-$(VER).so.0
|
||||
ln -sf libdhcp4client-$(VER).so.0 $(DESTDIR)/$(LIBDIR)/libdhcp4client.so
|
||||
install -p -m 0644 -D libdhcp4client.a $(DESTDIR)$(LIBDIR)/libdhcp4client.a
|
||||
install -p -m 0644 -D dhcp4client.h $(DESTDIR)$(INCDIR)/dhcp4client/dhcp4client.h
|
||||
for hdr in $(DHCP_HEADERS) ; do \
|
||||
install -p -m 0644 -D $(TOP)/includes/$${hdr} $(DESTDIR)$(INCDIR)/dhcp4client/$${hdr} ; \
|
||||
done
|
||||
|
||||
depend:
|
||||
$(MKDEP) $(INCLUDES) $(PREDEFINES) $(SRCS)
|
||||
|
||||
clean:
|
||||
-rm -f $(OBJS)
|
||||
|
||||
realclean: clean
|
||||
-rm -f $(PROG) *~ #*
|
||||
|
||||
distclean: realclean
|
||||
-rm -f Makefile
|
||||
|
||||
# This isn't the cleanest way to set up links, but I prefer this so I don't
|
||||
# need object targets for each subdirectory. The idea is simple. Since
|
||||
# libdhcp4client is a linked together wad of objects from across the source
|
||||
# tree, we change / to _ when linking source files here. Follow this example:
|
||||
#
|
||||
# We need to use client/dhclient.c, so we make this link:
|
||||
# rm -f client_dhclient.c
|
||||
# ln -s $(TOP)/client/dhclient.c client_dhclient.c
|
||||
#
|
||||
# Simple. Given the way the ISC build system works, this is the easiest to
|
||||
# maintain and least invasive.
|
||||
#
|
||||
# David Cantrell <dcantrell@redhat.com>
|
||||
links:
|
||||
@for target in $(SRCS); do \
|
||||
source="`echo $$target | sed -e 's|_|/|'`"; \
|
||||
if [ ! -b $$target ]; then \
|
||||
rm -f $$target; \
|
||||
fi; \
|
||||
ln -s $(TOP)/$$source $$target; \
|
||||
done; \
|
||||
for hdr in $(HDRS); do \
|
||||
if [ ! -b $$hdr ]; then \
|
||||
rm -f $$hdr; \
|
||||
fi; \
|
||||
ln -s $(TOP)/libdhcp4client/$$hdr $$hdr; \
|
||||
done
|
||||
|
||||
# minires is difficult to build because it overrides things in common and dst,
|
||||
# so we just link with the already built libres.a since we need it all anyway
|
||||
libres.a:
|
||||
if [ ! -f ../minires/$@ ]; then \
|
||||
$(MAKE) -C ../minires; \
|
||||
fi; \
|
||||
ln ../minires/libres.a .; \
|
||||
$(AR) x libres.a
|
||||
|
||||
# Create the libraries
|
||||
# minires/res_query.o contains an undefined symbol __h_errno_set, is not
|
||||
# used by any dhcp code, and is optimized out by the linker when producing
|
||||
# the dhclient executable or a shared library
|
||||
libdhcp4client.a: $(OBJS) libres.a
|
||||
$(AR) crus $@ $(OBJS) `$(AR) t libres.a | grep -v res_query.o`
|
||||
|
||||
libdhcp4client-$(VER).so.0: $(OBJS) libres.a
|
||||
$(CC) -shared -o $@ -Wl,-soname,$@ $(OBJS) `$(AR) t libres.a | grep -v res_query.o`
|
||||
|
||||
# Dependencies (semi-automatically-generated)
|
@ -1,3 +1,4 @@
|
||||
#
|
||||
# Makefile.dist for libdhcp4client
|
||||
#
|
||||
# We get the libdhcp4client library from the patched ISC source code. We
|
||||
@ -6,7 +7,25 @@
|
||||
# stuff enabled). We then link together a static library and a shared
|
||||
# library with the new resulting objects.
|
||||
#
|
||||
# Copyright (C) 2006, 2007 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing to use,
|
||||
# modify, copy, or redistribute it subject to the terms and conditions of
|
||||
# the GNU General Public License v.2, or (at your option) any later version.
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY expressed or implied, including the implied warranties of
|
||||
# MERCHANTABILITY or FITNESS FOR A * PARTICULAR PURPOSE. See the GNU General
|
||||
# Public License for more details. You should have received a copy of the
|
||||
# GNU General Public License along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA. Any Red Hat trademarks that are incorporated in the
|
||||
# source code or documentation are not subject to the GNU General Public
|
||||
# License and may only be used or replicated with the express permission of
|
||||
# Red Hat, Inc.
|
||||
#
|
||||
# Red Hat Author(s): Jason Vas Dias
|
||||
# David Cantrell <dcantrell@redhat.com>
|
||||
#
|
||||
|
||||
# What version of ISC DHCP is this?
|
||||
VER = $(shell grep DHCP_VERSION ../../includes/version.h | head -1 | cut -d '"' -f 2 | cut -d 'V' -f 2 | cut -d '-' -f 1)
|
||||
|
40
dhcp.spec
40
dhcp.spec
@ -13,7 +13,7 @@
|
||||
Summary: DHCP (Dynamic Host Configuration Protocol) server and relay agent
|
||||
Name: dhcp
|
||||
Version: 3.1.0
|
||||
Release: 5%{?dist}
|
||||
Release: 6%{?dist}
|
||||
# NEVER CHANGE THE EPOCH on this package. The previous maintainer made
|
||||
# incorrect use of the epoch and that's why it is at 12 now. It should have
|
||||
# never been used, but it was. So we are stuck with it.
|
||||
@ -31,7 +31,7 @@ Source6: README.ldap
|
||||
Source7: draft-ietf-dhc-ldap-schema-01.txt
|
||||
Source8: dhcpd-conf-to-ldap
|
||||
Source9: linux
|
||||
Source10: Makefile.dist
|
||||
Source10: Makefile.libdhcp4client
|
||||
Source11: dhcp4client.h
|
||||
Source12: libdhcp_control.h
|
||||
Source13: dhcp.schema
|
||||
@ -59,7 +59,8 @@ Patch19: %{name}-3.0.6-ignore-hyphen-x.patch
|
||||
Patch20: %{name}-3.1.0-warnings.patch
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildRequires: groff openldap-devel
|
||||
BuildRequires: groff
|
||||
BuildRequires: openldap-devel
|
||||
|
||||
Requires(post): /sbin/chkconfig
|
||||
Requires(preun): /sbin/chkconfig
|
||||
@ -232,20 +233,20 @@ libdhcp4client.
|
||||
%patch20 -p1 -b .warnings
|
||||
|
||||
# Copy in documentation and example scripts for LDAP patch to dhcpd
|
||||
%{__install} -p -m 0644 %SOURCE6 .
|
||||
%{__install} -p -m 0644 %SOURCE7 doc
|
||||
%{__install} -p -m 0755 %SOURCE8 contrib
|
||||
%{__install} -p -m 0644 %{SOURCE6} .
|
||||
%{__install} -p -m 0644 %{SOURCE7} doc/
|
||||
%{__install} -p -m 0755 %{SOURCE8} contrib/
|
||||
|
||||
# Copy in the Fedora/RHEL dhclient script
|
||||
%{__install} -p -m 0755 %SOURCE9 client/scripts
|
||||
%{__install} -p -m 0755 %{SOURCE9} client/scripts/
|
||||
|
||||
# Copy in the libdhcp4client headers and Makefile.dist
|
||||
%{__mkdir} -p libdhcp4client
|
||||
%{__install} -p -m 0644 %SOURCE10 libdhcp4client
|
||||
%{__install} -p -m 0644 %SOURCE11 libdhcp4client
|
||||
%{__install} -p -m 0644 %{SOURCE10} libdhcp4client/Makefile.dist
|
||||
%{__install} -p -m 0644 %{SOURCE11} libdhcp4client/
|
||||
|
||||
# Copy in libdhcp_control.h to the isc-dhcp includes directory
|
||||
%{__install} -p -m 0644 %SOURCE12 includes/isc-dhcp
|
||||
%{__install} -p -m 0644 %{SOURCE12} includes/isc-dhcp/
|
||||
|
||||
# Ensure we don't pick up Perl as a dependency from the scripts and modules
|
||||
# in the contrib directory (we copy this to /usr/share/doc in the final
|
||||
@ -262,7 +263,7 @@ libdhcp4client.
|
||||
%{__sed} -i -e 's/\r//' __fedora_contrib/ms2isc/ms2isc.pl
|
||||
|
||||
%build
|
||||
%{__cp} %SOURCE1 .
|
||||
%{__cp} %{SOURCE1} .
|
||||
%{__cat} <<EOF > site.conf
|
||||
VARDB=%{_localstatedir}/lib/dhcpd
|
||||
ADMMANDIR=%{_mandir}/man8
|
||||
@ -290,7 +291,7 @@ CC="%{__cc}" ./configure \
|
||||
--copts "$RPM_OPT_FLAGS $COPTS %{?bigptrs}" \
|
||||
--work-dir %{workdir}
|
||||
|
||||
%{__sed} 's/@DHCP_VERSION@/%{version}/' < %SOURCE5 > libdhcp4client.pc
|
||||
%{__sed} 's/@DHCP_VERSION@/%{version}/' < %{SOURCE5} > libdhcp4client.pc
|
||||
%{__make} %{?_smp_mflags} CC="%{__cc}"
|
||||
|
||||
%install
|
||||
@ -298,10 +299,10 @@ CC="%{__cc}" ./configure \
|
||||
%{__mkdir} -p %{buildroot}%{_sysconfdir}/sysconfig
|
||||
|
||||
%{__make} install DESTDIR=%{buildroot}
|
||||
%{__install} -p -m 0644 %SOURCE12 %{buildroot}%{_includedir}/isc-dhcp
|
||||
%{__install} -p -m 0644 %{SOURCE12} %{buildroot}%{_includedir}/isc-dhcp/
|
||||
|
||||
%{__mkdir} -p %{buildroot}%{_initrddir}
|
||||
%{__install} -p -m 0755 %SOURCE2 %{buildroot}%{_initrddir}/dhcpd
|
||||
%{__install} -p -m 0755 %{SOURCE2} %{buildroot}%{_initrddir}/dhcpd
|
||||
|
||||
touch %{buildroot}%{_localstatedir}/lib/dhcpd/dhcpd.leases
|
||||
%{__mkdir} -p %{buildroot}%{_localstatedir}/lib/dhclient/
|
||||
@ -310,7 +311,7 @@ touch %{buildroot}%{_localstatedir}/lib/dhcpd/dhcpd.leases
|
||||
DHCPDARGS=
|
||||
EOF
|
||||
|
||||
%{__install} -p -m 0755 %SOURCE3 %{buildroot}%{_initrddir}/dhcrelay
|
||||
%{__install} -p -m 0755 %{SOURCE3} %{buildroot}%{_initrddir}/dhcrelay
|
||||
|
||||
%{__cat} <<EOF > %{buildroot}%{_sysconfdir}/sysconfig/dhcrelay
|
||||
# Command line options here
|
||||
@ -323,11 +324,11 @@ EOF
|
||||
%{__chmod} 0755 %{buildroot}/sbin/dhclient-script
|
||||
|
||||
# Install default (empty) dhcpd.conf:
|
||||
%{__cp} -fp %SOURCE4 %{buildroot}%{_sysconfdir}
|
||||
%{__cp} -fp %{SOURCE4} %{buildroot}%{_sysconfdir}
|
||||
|
||||
# Install dhcp.schema for LDAP configuration
|
||||
%{__mkdir} -p %{buildroot}%{_sysconfdir}/openldap
|
||||
%{__install} -p -m 0644 -D %SOURCE13 %{buildroot}%{_sysconfdir}/openldap
|
||||
%{__install} -p -m 0644 -D %{SOURCE13} %{buildroot}%{_sysconfdir}/openldap/
|
||||
|
||||
%{__install} -p -m 0644 -D libdhcp4client.pc %{buildroot}%{_libdir}/pkgconfig/libdhcp4client.pc
|
||||
|
||||
@ -428,6 +429,11 @@ fi
|
||||
%{_libdir}/libdhcp4client.a
|
||||
|
||||
%changelog
|
||||
* Thu Oct 25 2007 David Cantrell <dcantrell@redhat.com> - 12:3.1.0-6
|
||||
- Rename Makefile.dist to Makefile.libdhcp4client
|
||||
- Spec file cleanups
|
||||
- Include stdarg.h in libdhcp_control.h
|
||||
|
||||
* Thu Oct 25 2007 David Cantrell <dcantrell@redhat.com> - 12:3.1.0-5
|
||||
- Remove chkconfig usage for ypbind in dhclient-script (#351211)
|
||||
- Combine dhcp-static and dhcp-devel packages since there are no shared
|
||||
|
@ -19,7 +19,7 @@
|
||||
* Red Hat, Inc.
|
||||
*
|
||||
* Red Hat Author(s): Jason Vas Dias
|
||||
* David Cantrell
|
||||
* David Cantrell <dcantrell@redhat.com>
|
||||
*/
|
||||
|
||||
/* include libdhcp_control.h or libdhcp.h for this */
|
||||
|
@ -24,8 +24,9 @@
|
||||
* Red Hat, Inc.
|
||||
*
|
||||
* Red Hat Author(s): Jason Vas Dias
|
||||
* David Cantrell
|
||||
* David Cantrell <dcantrell@redhat.com>
|
||||
*/
|
||||
|
||||
#ifndef LIBDHCP_CONTROL_H
|
||||
#define LIBDHCP_CONTROL_H
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user