From a10f0b1cf591ebf23a7fc3303571c6a6de4d4738 Mon Sep 17 00:00:00 2001 From: agibert Date: Tue, 15 Jul 2003 23:53:15 +0000 Subject: [PATCH] Initial release. --- Makefile | 22 ++++ Makefile.rule | 342 ++++++++++++++++++++++++++++++++++++++++++++++++++ Makefile.var | 72 +++++++++++ doc/Makefile | 5 + lib/Makefile | 34 ++--- libnode.spec | 50 ++++++++ 6 files changed, 510 insertions(+), 15 deletions(-) create mode 100644 Makefile create mode 100644 Makefile.rule create mode 100644 Makefile.var create mode 100644 doc/Makefile create mode 100644 libnode.spec diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f3e0ab1 --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +# $RCSfile: Makefile,v $ +# $Revision: 1.1 $ +# $Name: $ +# $Date: 2003/07/15 23:53:15 $ +# $Author: agibert $ + +#------------------------------------------------------------------------------ +# Main Makefile +#------------------------------------------------------------------------------ +# Marc Regimbeau +#------------------------------------------------------------------------------ + + + +SUBDIRS := doc lib util demo + +FILE_DOC := *.txt + + + +include Makefile.var +include Makefile.rule diff --git a/Makefile.rule b/Makefile.rule new file mode 100644 index 0000000..06e2b09 --- /dev/null +++ b/Makefile.rule @@ -0,0 +1,342 @@ +# $RCSfile: Makefile.rule,v $ +# $Revision: 1.1 $ +# $Name: $ +# $Date: 2003/07/15 23:53:15 $ +# $Author: agibert $ + + + +# ----------------- DEFAULT RULES --------------------- +default:all + + + +# ----------------- IMPLICITES RULES --------------------- + +# Here are all the rules allowing to compile sources files +# c -> o +%.o:%.c + $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ + +# c -> executable +.c : + $(CC) $(CFLAGS) $(INCLUDE) $< -o $@ -I . $(LIB) + +# o -> executable +%:%.o + $(CC) $(LFLAGS) -o $@ $? $(LIB) + +# .o -> .so +%.so:%.o + $(CC) $(LDSOFLAGS) -shared -o $@ $? $(LIB) + +%.a:%.o + $(AR) -r $@ $? + +$(OBJECTS) : $(SRC) + + + +# "depend" rule allow to build the dependancy file +depend: + + + +# "all" Rule +all: dir_all +ifneq ($(SUBDIRS),) + for d in $(SUBDIRS) ; do $(MAKE) all -C $$d/ ; done +endif + +dir_all: $(TARGETS) + + + +# "clean" Rule +clean: dir_clean +ifneq ($(SUBDIRS),) + for d in $(SUBDIRS) ; do $(MAKE) clean -C $$d/ ; done +endif + +dir_clean: + @(command="$(RM) $(TARGETS) $$(echo $(SRC) | sed "s/\.c/\.o/g") ;" ; \ + echo $$command ; \ + eval $$command ;) + + + +# "pre_install" Rule +# This empty rule can be overiden in module Makefile in order to run pre-install commands. +pre_install: + + + +# "post_install" Rule +# This empty rule can be overiden in module Makefile in order to run post-install commands. +post_install: + + + +# "install" Rule +install: dir_install +ifneq ($(SUBDIRS),) + for d in $(SUBDIRS) ; do $(MAKE) install -C $$d/ ; done +endif + +dir_install: dir_all + $(MAKE) pre_install +ifneq ($(FILE_BIN),) + @if test ! -d $(PATH_BIN) ; then $(MKD) $(PATH_BIN) ; fi + $(INSTALLBIN) $(FILE_BIN) $(PATH_BIN) +endif +ifneq ($(FILE_BINSUID),) + @if test ! -d $(PATH_BINSUID) ; then $(MKD) $(PATH_BINSUID) ; fi + $(INSTALLBINSUID) $(FILE_BINSUID) $(PATH_BINSUID) +endif +ifneq ($(FILE_CGI),) + @if test ! -d $(PATH_CGI) ; then $(MKD) $(PATH_CGI) ; fi + $(INSTALLCGI) $(FILE_CGI) $(PATH_CGI) +endif +ifneq ($(FILE_DOC),) + @if test ! -d $(PATH_DOC) ; then $(MKD) $(PATH_DOC) ; fi + $(INSTALLDOC) $(FILE_DOC) $(PATH_DOC) +endif +ifneq ($(FILE_ETC),) + @if test ! -d $(PATH_ETC) ; then $(MKD) $(PATH_ETC) ; fi + $(INSTALLETC) $(FILE_ETC) $(PATH_ETC) +endif +ifneq ($(FILE_HOME),) + @if test ! -d $(PATH_HOME) ; then $(MKD) $(PATH_HOME) ; fi + $(INSTALLHOME) $(FILE_HOME) $(PATH_HOME) +endif +ifneq ($(FILE_HOMEBIN),) + @if test ! -d $(PATH_HOMEBIN) ; then $(MKD) $(PATH_HOMEBIN) ; fi + $(INSTALLHOMEBIN) $(FILE_HOMEBIN) $(PATH_HOMEBIN) +endif +ifneq ($(FILE_LIB),) + @if test ! -d $(PATH_LIB) ; then $(MKD) $(PATH_LIB) ; fi + $(INSTALLLIB) $(FILE_LIB) $(PATH_LIB) +endif +ifneq ($(FILE_HOMELIB),) + @if test ! -d $(PATH_HOMELIB) ; then $(MKD) $(PATH_HOMELIB) ; fi + $(INSTALLHOMELIB) $(FILE_HOMELIB) $(PATH_HOMELIB) +endif +ifneq ($(FILE_INCLUDE),) + @if test ! -d $(PATH_INCLUDE) ; then $(MKD) $(PATH_INCLUDE) ; fi + $(INSTALLINCLUDE) $(FILE_INCLUDE) $(PATH_INCLUDE) +endif +ifneq ($(FILE_MAN),) + @for d in $(FILE_MAN) ; do \ + if test ! -d $(PATH_MAN)/$(FILE_MAN) ; then \ + $(MKD) $(PATH_MAN)/$(FILE_MAN) ; \ + fi ; \ + $(INSTALLMAN) $(FILE_MAN)/* $(PATH_MAN)/$(FILE_MAN) ; \ + done +endif +ifneq ($(FILE_WEBCONF),) + @if test ! -d $(PATH_WEBCONF) ; then $(MKD) $(PATH_WEBCONF) ; fi + $(INSTALLWEBCONF) $(FILE_WEBCONF) $(PATH_WEBCONF) +endif +ifneq ($(FILE_WEBCONFSSL),) + @if test ! -d $(PATH_WEBCONFSSL) ; then $(MKD) $(PATH_WEBCONFSSL) ; fi + $(INSTALLWEBCONFSSL) $(FILE_WEBCONFSSL) $(PATH_WEBCONFSSL) +endif +ifneq ($(FILE_HTML),) + @if test ! -d $(PATH_HTML) ; then $(MKD) $(PATH_HTML) ; fi + $(INSTALLHTML) $(FILE_HTML) $(PATH_HTML) +endif +ifneq ($(FILE_WEBICONS),) + @if test ! -d $(PATH_WEBICONS) ; then $(MKD) $(PATH_WEBICONS) ; fi + $(INSTALLWEBICONS) $(FILE_WEBICONS) $(PATH_WEBICONS) +endif + $(MAKE) post_install + + + +# "pre_uninstall" Rule +# This empty rule can be overiden in module Makefile in order to run pre-uninstall commands. + +pre_uninstall: + + + +# "post_uninstall" Rule +# This empty rule can be overiden in module Makefile in order to run post-uninstall commands. +post_uninstall: + + + +# "uninstall" Rule +uninstall: dir_uninstall +ifneq ($(SUBDIRS),) + for d in $(SUBDIRS) ; do $(MAKE) uninstall -C $$d/ ; done +endif + +dir_uninstall: + $(MAKE) pre_uninstall +ifneq ($(FILE_BIN),) + @(if test -d $(PATH_BIN) ; then \ + $(CD) $(PATH_BIN) ; \ + (echo $(MAKEFLAGS) | grep s) > /dev/null ; \ + if [ $$? -ne 0 ] ; then \ + echo "$(CD) $(PATH_BIN)" ; \ + echo "$(RM) $(FILE_BIN)" ; \ + fi ; \ + $(RM) $(FILE_BIN) ; \ + fi) +endif +ifneq ($(FILE_BINSUID),) + @(if test -d $(PATH_BINSUID) ; then \ + $(CD) $(PATH_BINSUID) ; \ + (echo $(MAKEFLAGS) | grep s) > /dev/null ; \ + if [ $$? -ne 0 ] ; then \ + echo "$(CD) $(PATH_BINSUID)" ; \ + echo "$(RM) $(FILE_BINSUID)" ; \ + fi ; \ + $(RM) $(FILE_BINSUID) ; \ + fi) +endif +ifneq ($(FILE_CGI),) + @(if test -d $(PATH_CGI) ; then \ + $(CD) $(PATH_CGI) ; \ + (echo $(MAKEFLAGS) | grep s) > /dev/null ; \ + if [ $$? -ne 0 ] ; then \ + echo "$(CD) $(PATH_CGI)" ; \ + echo "$(RM) $(FILE_CGI)" ; \ + fi ; \ + $(RM) $(FILE_CGI) ; \ + fi) +endif +ifneq ($(FILE_DOC),) + @(if test -d $(PATH_DOC) ; then \ + $(CD) $(PATH_DOC) ; \ + (echo $(MAKEFLAGS) | grep s) > /dev/null ; \ + if [ $$? -ne 0 ] ; then \ + echo "$(CD) $(PATH_DOC)" ; \ + echo "$(RM) $(FILE_DOC)" ; \ + fi ; \ + $(RM) $(FILE_DOC) ; \ + fi) +endif +ifneq ($(FILE_ETC),) + @(if test -d $(PATH_ETC) ; then \ + $(CD) $(PATH_ETC) ; \ + (echo $(MAKEFLAGS) | grep s) > /dev/null ; \ + if [ $$? -ne 0 ] ; then \ + echo "$(CD) $(PATH_ETC)" ; \ + echo "$(RM) $(FILE_ETC)" ; \ + fi ; \ + $(RM) $(FILE_ETC) ; \ + fi) +endif +ifneq ($(FILE_HOME),) + @(if test -d $(PATH_HOME) ; then \ + $(CD) $(PATH_HOME) ; \ + (echo $(MAKEFLAGS) | grep s) > /dev/null ; \ + if [ $$? -ne 0 ] ; then \ + echo "$(CD) $(PATH_HOME)" ; \ + echo "$(RM) $(FILE_HOME)" ; \ + fi ; \ + $(RM) $(FILE_HOME) ; \ + fi) +endif +ifneq ($(FILE_HOMEBIN),) + @(if test -d $(PATH_HOMEBIN) ; then \ + $(CD) $(PATH_HOMEBIN) ; \ + (echo $(MAKEFLAGS) | grep s) > /dev/null ; \ + if [ $$? -ne 0 ] ; then \ + echo "$(CD) $(PATH_HOMEBIN)" ; \ + echo "$(RM) $(FILE_HOMEBIN)" ; \ + fi ; \ + $(RM) $(FILE_HOMEBIN) ; \ + fi) +endif +ifneq ($(FILE_LIB),) + @(if test -d $(PATH_LIB) ; then \ + $(CD) $(PATH_LIB) ; \ + (echo $(MAKEFLAGS) | grep s) > /dev/null ; \ + if [ $$? -ne 0 ] ; then \ + echo "$(CD) $(PATH_LIB)" ; \ + echo "$(RM) $(FILE_LIB)" ; \ + fi ; \ + $(RM) $(FILE_LIB) ; \ + fi) +endif +ifneq ($(FILE_HOMELIB),) + @(if test -d $(PATH_HOMELIB) ; then \ + $(CD) $(PATH_HOMELIB) ; \ + (echo $(MAKEFLAGS) | grep s) > /dev/null ; \ + if [ $$? -ne 0 ] ; then \ + echo "$(CD) $(PATH_HOMELIB)" ; \ + echo "$(RM) $(FILE_HOMELIB)" ; \ + fi ; \ + $(RM) $(FILE_HOMELIB) ; \ + fi) +endif +ifneq ($(FILE_INCLUDE),) + @(if test -d $(PATH_INCLUDE) ; then \ + $(CD) $(PATH_INCLUDE) ; \ + (echo $(MAKEFLAGS) | grep s) > /dev/null ; \ + if [ $$? -ne 0 ] ; then \ + echo "$(CD) $(PATH_INCLUDE)" ; \ + echo "$(RM) $(FILE_INCLUDE)" ; \ + fi ; \ + $(RM) $(FILE_INCLUDE) ; \ + fi) +endif +ifneq ($(FILE_MAN),) + @(if test -d $(PATH_MAN) ; then \ + $(CD) $(PATH_MAN) ; \ + (echo $(MAKEFLAGS) | grep s) > /dev/null ; \ + if [ $$? -ne 0 ] ; then \ + echo "$(CD) $(PATH_MAN)" ; \ + echo "$(RM) $(FILE_MAN)" ; \ + fi ; \ + $(RM) $(FILE_MAN) ; \ + fi) +endif +ifneq ($(FILE_WEBCONF),) + @(if test -d $(PATH_WEBCONF) ; then \ + $(CD) $(PATH_WEBCONF) ; \ + (echo $(MAKEFLAGS) | grep s) > /dev/null ; \ + if [ $$? -ne 0 ] ; then \ + echo "$(CD) $(PATH_WEBCONF)" ; \ + echo "$(RM) $(FILE_WEBCONF)" ; \ + fi ; \ + $(RM) $(FILE_WEBCONF) ; \ + fi) +endif +ifneq ($(FILE_WEBCONFSSL),) + @(if test -d $(PATH_WEBCONFSSL) ; then \ + $(CD) $(PATH_WEBCONFSSL) ; \ + (echo $(MAKEFLAGS) | grep s) > /dev/null ; \ + if [ $$? -ne 0 ] ; then \ + echo "$(CD) $(PATH_WEBCONFSSL)" ; \ + echo "$(RM) $(FILE_WEBCONFSSL)" ; \ + fi ; \ + $(RM) $(FILE_WEBCONFSSL) ; \ + fi) +endif +ifneq ($(FILE_HTML),) + @(if test -d $(PATH_HTML) ; then \ + $(CD) $(PATH_HTML) ; \ + (echo $(MAKEFLAGS) | grep s) > /dev/null ; \ + if [ $$? -ne 0 ] ; then \ + echo "$(CD) $(PATH_HTML)" ; \ + echo "$(RM) $(FILE_HTML)" ; \ + fi ; \ + $(RM) $(FILE_HTML) ; \ + fi) +endif +ifneq ($(FILE_WEBICONS),) + @(if test -d $(PATH_WEBICONS) ; then \ + $(CD) $(PATH_WEBICONS) ; \ + (echo $(MAKEFLAGS) | grep s) > /dev/null ; \ + if [ $$? -ne 0 ] ; then \ + echo "$(CD) $(PATH_WEBICONS)" ; \ + echo "$(RM) $(FILE_WEBICONS)" ; \ + fi ; \ + $(RM) $(FILE_WEBICONS) ; \ + fi) +endif + $(MAKE) post_uninstall diff --git a/Makefile.var b/Makefile.var new file mode 100644 index 0000000..69a804b --- /dev/null +++ b/Makefile.var @@ -0,0 +1,72 @@ +# $RCSfile: Makefile.var,v $ +# $Revision: 1.1 $ +# $Name: $ +# $Date: 2003/07/15 23:53:15 $ +# $Author: agibert $ + +PROG_NAME=libnode +PROG_VERSION_NAME=libnode-2.0.5-1 + +CC=/usr/bin/gcc +AR=/usr/bin/ar + +CD=cd +MKDIR=/bin/mkdir -p +RM=/bin/rm -f +PATH_WEB=$(addprefix /var/httpd/, $(PROG_NAME)) + +INSTALLBIN=/usr/bin/install -m 755 +INSTALLBINSUID=/usr/bin/install -m 4755 +INSTALLCGI=/usr/bin/install -m 555 +INSTALLDOC=/usr/bin/install -m 444 +INSTALLETC=/usr/bin/install -m 600 +INSTALLHOME=/usr/bin/install -m 400 +INSTALLHOMEBIN=/usr/bin/install -m 750 +INSTALLLIB=/usr/bin/install -m 755 +INSTALLHOMELIB=/usr/bin/install -m 755 +INSTALLINCLUDE=/usr/bin/install -m 644 +INSTALLMAN=/usr/bin/install -m 644 +INSTALLWEBCONF=/usr/bin/install -m 644 +INSTALLWEBCONFSSL=/usr/bin/install -m 644 +INSTALLHTML=/usr/bin/install -m 444 +INSTALLWEBICONS=/usr/bin/install -m 444 + +ifeq ($(ROOT),) + HOME_DIR := / +else + HOME_DIR := $(ROOT) +endif + +PATH_BIN := $(addprefix $(HOME_DIR),/usr/bin) +PATH_BINSUID := $(PATH_BIN) +PATH_CGI := $(addprefix $(HOME_DIR),$(addprefix $(PATH_WEB),/cgi-bin)) +PATH_DOC := $(addprefix $(HOME_DIR),$(addprefix /usr/share/doc/,$(PROG_VERSION_NAME))) +PATH_ETC := $(addprefix $(HOME_DIR),$(addprefix /etc/,$(MODULE))) +PATH_HOME := $(addprefix $(HOME_DIR),$(addprefix $(addprefix /var/lib/, $(PROG_NAME)), $(MODULE))) +PATH_HOMEBIN := $(addprefix $(HOME_DIR), $(addprefix $(addprefix /var/lib/, $(PROG_NAME)), /bin)) +PATH_LIB := $(addprefix $(HOME_DIR),/usr/lib) +PATH_HOMELIB := $(addprefix $(HOME_DIR), $(addprefix $(addprefix /var/lib/, $(PROG_NAME)), /lib)) +PATH_INCLUDE := $(addprefix $(HOME_DIR),/usr/include) +PATH_MAN := $(addprefix $(HOME_DIR),/usr/share/man) +PATH_WEBCONF := $(addprefix $(HOME_DIR),/etc/httpd/conf/vhosts) +PATH_WEBCONFSSL := $(addprefix $(HOME_DIR),/etc/httpd/conf/ssl) +PATH_HTML := $(addprefix $(HOME_DIR),$(addprefix $(addprefix $(PATH_WEB),/html/),$(MODULE))) +PATH_WEBICONS := $(addprefix $(HOME_DIR),$(addprefix $(PATH_WEB),/icons)) + +PATH_LOG := $(addprefix $(HOME_DIR),/var/log) + +CFLAGS= + +ifeq ($(DEBUG), YES) + CFLAGS += -g -D_DEBUG +endif +ifeq ($(DEBUG), Y) + CFLAGS += -g -D_DEBUG +endif + +ifeq ($(OPTIM), YES) + CFLAGS += -O3 +endif +ifeq ($(OPTIM), Y) + CFLAGS += -O3 +endif diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000..96108e3 --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,5 @@ +FILE_DOC := libnode.doc +FILE_MAN := man3 + +include ../Makefile.var +include ../Makefile.rule diff --git a/lib/Makefile b/lib/Makefile index b5c0a33..f5dd147 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -1,19 +1,23 @@ -ifdef LIBVER_SUPPORT - DEP += ../../libver/lib/ver.h - LIBDIR += -I ../../libver/lib - FLAG += -D_LIBVER_SUPPORT +SRC := libnode.c +TARGETS := libnode.a libnode.so +FILE_LIB := libnode.a libnode.so +FILE_INCLUDE := node.h + + + +include ../Makefile.var +include ../Makefile.rule + + + +DEP = libnode.h ../include/node.h Makefile +INCLUDE = -I . -I ../include + +ifdef _LIBVER_SUPPORT + DEP += ../../libver/ver.h + INCLUDE += -I ../../libver/lib endif -all: libnode.a libnode.so -libnode.o: libnode.c node.h libnode.h $(DEP) Makefile - gcc -c -g -o libnode.o $(FLAG) -I . $(LIBDIR) libnode.c -libnode.a: libnode.o - ar -r libnode.a libnode.o - -libnode.so: libnode.o - ld -shared -o libnode.so libnode.o - -clean: - rm -f libnode.o libnode.a libnode.so +libnode.o : libnode.c $(DEP) diff --git a/libnode.spec b/libnode.spec new file mode 100644 index 0000000..aefd9aa --- /dev/null +++ b/libnode.spec @@ -0,0 +1,50 @@ +Name: libnode +Version: 2.0.5 +Release: 1 + +Summary: Manages generic list and/or tree node structures +Copyright: GPL +Group: Application/Utilitaires +Distribution: Rx3 OpenSource +Vendor: Rx3 +Packager: arnaud.gibert@rx3.net + +Source: ftp://ftp.rx3.org/pub/%{name}-%{version}-%{release}.tgz +Url: http://www.rx3.org/dvp/libnode/download/ +BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot +AutoReqProv: no + +%description +Manages generic list and/or tree node structures + +%define source %{name}-%{version}-%{release}.tgz + +%files +/usr + +#%prep + +#%setup + +%build +rm -rf libnode-2.0.4-1 +tar -xzvvf /usr/src/RPM/SOURCES/%{source} +cd libnode-2.0.4-1 +make clean +make all + +%install +cd libnode-2.0.4-1 +make install ROOT=$RPM_BUILD_ROOT +chmod 755 $RPM_BUILD_ROOT/usr/share/doc/libnode-$RPM_PACKAGE_VERSION/ndbench* $RPM_BUILD_ROOT/usr/share/doc/libnode-$RPM_PACKAGE_VERSION/demo0 + +%clean +rm -rf libnode-2.0.4-1 +rm -rf $RPM_BUILD_ROOT + +%changelog +* Tue Jul 15 2003 Arnaud G. Gibert - 2.0.5-1 +- Add release in libnode dir name support. + +* Tue Jul 15 2003 Marc Regimbeau - 2.0.4-2 +- Initial release of this spec file.