Skip to content

Commit

Permalink
Changes for RPM packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
dancy committed Feb 22, 2006
1 parent d1e1e73 commit 5c58d37
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 32 deletions.
15 changes: 15 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
*** Don't forget to consider incrementing the version number in ftpd.cl
*** [and leave this message at the top of the file]

2006-02-22 Ahmon Dancy <dancy@dancy>

* Modifications for RPM packaging.

* new: aftpd.spec.
* modified: aftpd.init: Do not specify any runlevels by default.
It is not appropriate to automatically enable a security sensitive
program like an FTP server.
* modified: config.cl: Removed some text at the beginning of the
file. This file will be used as /etc/aftpd.cl.
* modified: makefile: Many changes to the install-common rule to
aid in rpm packaging.
* new: aftpd.logrotate: Logrotate config.


2005-12-19 Kevin Layer <layer@relay.known.net>

* makefile: preferred lisp => 8.0; better install for SuSE
Expand Down
5 changes: 3 additions & 2 deletions aftpd.init
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
#
# aftpd Allegro FTP daemon
#
# chkconfig: 345 99 01
# chkconfig: - 99 01
# description: FTP server
# processname: aftpd
# config: /etc/aftpd.cl

installdir=/usr/local/sbin/aftpd
installdir=/usr/sbin

# Source function library.
. /etc/init.d/functions
Expand Down
62 changes: 62 additions & 0 deletions aftpd.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# $Id: aftpd.spec,v 1.1 2006/02/22 17:35:21 dancy Exp $
Summary: Allegro FTP daemon
Name: aftpd
Version: 1.0.28
Release: 1
License: LLGPL
Group: System Environment/Daemons
Provides: ftpserver
#BuildRequires: allegrocl >= 7.0
Requires: logrotate
Prereq: /sbin/chkconfig, /sbin/service
URL: http://opensource.franz.com/aftpd/
Source0: %{name}-%{version}-src.tgz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root

%description
Allegro FTPd is an FTP server for Linux/Solaris written in Allegro
Common Lisp. Because it is written in Common Lisp, one class of
security issues, related to buffer overflows, has been eliminated.

%prep
%setup -q -n %{name}-%{version}-src

%build
make

%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%makeinstall
# Need to re-make the aftpd symbolic link here so that rpm knows about it.
rm $RPM_BUILD_ROOT/%{_sbindir}/aftpd
ln -s %{_libdir}/aftpd/aftpd $RPM_BUILD_ROOT/%{_sbindir}/aftpd
#
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
cp aftpd.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/aftpd

%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
/etc/init.d/aftpd
%{_sbindir}/aftpd
%{_libdir}/aftpd/*
%config(noreplace) %{_sysconfdir}/aftpd.cl
%config(noreplace) /etc/logrotate.d/aftpd
%doc BUGS ChangeLog readme.txt binary-license.txt

%post
/sbin/chkconfig --add aftpd

%preun
if [ $1 = 0 ]; then
/sbin/service aftpd stop > /dev/null 2>&1
/sbin/chkconfig --del aftpd
fi

%changelog
* Tue Feb 21 2006 Ahmon Dancy <dancy@dancy> - 1.0.28-1
- Initial build.

15 changes: 1 addition & 14 deletions config.cl
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
;; $Id: config.cl,v 1.5 2002/12/18 17:47:38 layer Exp $
;;
;; IMPORTANT:
;; This file merely contains the default values for aFTPd and changing
;; the values here without rebuilding from source will NOT change the
;; behavior of an already built aFTPd.
;;
;; To override a default configuration value, simply supply a setq of the
;; variable with a new value in /etc/aftpd.cl. For example, to change the
;; log file, put this into /etc/aftpd.cl:
;;
;; (setq *logfile* "/var/log/aftp")
;;
;; and restart aFTPd.
;; $Id: config.cl,v 1.6 2006/02/22 17:35:21 dancy Exp $

(defparameter *logfile* "/var/log/ftp")
(defparameter *xferlog* "/var/log/xferlog")
Expand Down
42 changes: 26 additions & 16 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# (http://opensource.franz.com/preamble.html),
# known as the LLGPL.
#
# $Id: makefile,v 1.25 2006/01/01 14:57:38 dancy Exp $
# $Id: makefile,v 1.26 2006/02/22 17:35:21 dancy Exp $
#
# This makefile requires GNU make.

Expand All @@ -25,14 +25,22 @@ mlisp:=$(shell if test -x $(preferred_lisp); then \
echo mlisp; \
fi)

INSTALLDIR=/usr/local/sbin
prefix ?= /usr/local
sbindir ?= $(prefix)/sbin
sysconfdir ?= /etc
libdir ?= $(prefix)/lib
DOCDIR = $(prefix)/share/doc/aftpd

EXE = $(sbindir)/aftpd
LIB = $(libdir)/aftpd

version = $(shell grep defvar..ftpd-version ftpd.cl | sed -e 's,.*"\([0-9.]*\)".*,\1,')
platform = $(shell uname -s)

SOURCE_FILES = BUGS ChangeLog readme.txt binary-license.txt \
DOC_FILES = BUGS ChangeLog readme.txt binary-license.txt
SOURCE_FILES = $(DOC_FILES) \
config.cl ftpd.cl ipaddr.cl makefile \
rfc0959.txt S99aftpd aftpd.init rc.aftpd.sh
rfc0959.txt S99aftpd aftpd.init rc.aftpd.sh aftpd.logrotate

default: FORCE
rm -f build.tmp
Expand All @@ -53,8 +61,7 @@ pre-dist: FORCE
aftpd.init \
rc.aftpd.sh \
config.cl \
readme.txt \
binary-license.txt \
$(DOC_FILES) \
aftpd-$(version)

linux solaris freebsd: clean default pre-dist
Expand All @@ -70,22 +77,25 @@ clean: FORCE
rm -fr aftpd *.fasl autoloads.out build.tmp

install-common: FORCE
rm -fr $(INSTALLDIR)/aftpd
mkdir -p $(INSTALLDIR)
cp -pr aftpd $(INSTALLDIR)
cp -p readme.txt $(INSTALLDIR)/aftpd
cp -p config.cl $(INSTALLDIR)/aftpd
cp -p binary-license.txt $(INSTALLDIR)/aftpd
rm -fr $(LIB) $(EXE)
mkdir -p $(LIB) $(sbindir)
cp -p aftpd/* $(LIB)
ln -s $(LIB)/aftpd $(EXE)
mkdir -p $(sysconfdir)
if [ ! -f $(sysconfdir)/aftpd.cl ]; then cp config.cl $(sysconfdir)/aftpd.cl; fi

install-doc: FORCE
mkdir -p $(DOCDIR)
cp -p $(DOC_FILES) $(DOCDIR)

ifeq ($(platform),Linux)
SUSE = $(shell if grep -qs SuSE /etc/issue; then echo yes; else echo no; fi)
install: install-common
mkdir -p $(RPM_BUILD_ROOT)/etc/init.d
ifeq ($(SUSE),yes)
cp -p aftpd.init.suse90 /etc/init.d/aftpd
/sbin/chkconfig --set aftpd on
cp -p aftpd.init.suse90 $(RPM_BUILD_ROOT)/etc/init.d/aftpd
else
cp -p aftpd.init /etc/init.d/aftpd
/sbin/chkconfig aftpd reset
cp -p aftpd.init $(RPM_BUILD_ROOT)/etc/init.d/aftpd
endif
endif

Expand Down

0 comments on commit 5c58d37

Please sign in to comment.