[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Advice on Makefile/rules

On Thu, 19 Sep 2002, andrej hocevar wrote:

> Hello.
> I've written a (little) program in Perl that I packaged for personal
> use and everything works fine. Now I've been considering if I should
> give it to archive so that people can use it. (This is an issue by
> itself, so let's leave it for now.)
> Even though the package, as well as the program itself, work fine, I
> feel that I have to tune the package a little, if it's ever to
> become part of the archive. So I ask you for help here as I don't
> have much experience with Makefile/rules files.
> My Makefile is pretty short: the "build": target only makes the
> manpage from the .pod file and then "install" moves some files
> around -- the program, the manpage and two scripts for
> ip-{up,down}.d. What's with the "clean" target? Should I edit the
> rules file at all? If there's a Debian-way, I probably have to
> follow it, right? I've followed the procedure in the "New
> Maintainers' Guide". And what about the log file? When and how
> should it be removed (remove : purge)?

Debian is not about having every little script be packaged.  My guess is the
community would be better served by placing this script, in deb form, on your
own personal webpage.

#!/usr/bin/make -f

prefix = /usr/local
bindir = $(prefix)/bin
sysconfdir = /etc
mandir = $(prefix)/man
man1dir = $(mandir)/man1
sdown = $(sysconfdir)/ppp/ip-down.d
sup = $(sysconfdir)/ppp/ip-up.d

INSTALL = install
INSTALL_DIR = $(INSTALL) -d -m 755

POD2MAN = pod2man

	$(POD2MAN) sumo.pod > sumo.1.new
	mv sumo.1.new sumo.1

	-rm sumo.1.new sumo.1

	$(INSTALL_DIR) $(DESTDIR)$(bindir)
	$(INSTALL_DIR) $(DESTDIR)$(man1dir)
	$(INSTALL_DIR) $(DESTDIR)$(sdowndir)
	$(INSTALL_DIR) $(DESTDIR)$(supdir)

	$(INSTALL_PROGRAM) sumo $(bindir)/sumo
	$(INSTALL_DATA) sumo.1 $(man1dir)/sumo.1
	$(INSTALL_DATA) dsumo $(sdowndir)/dsumo
	$(INSTALL_DATA) usumo $(supdir)/usumo

	-rm $(DESTDIR)$(bindir)/sumo
	-rm $(DESTDIR)$(man1dir)/sumo.1
	-rm $(DESTDIR)$(sdowndir)/dsumo
	-rm $(DESTDIR)$(supdir)/usumo

Reply to: