Replace the install script by a Makefile.

pull/17/merge
Benjamin Drung 9 years ago
parent 2ca445e5f7
commit 48064d23ef
  1. 31
      Makefile
  2. 26
      install.sh

@ -0,0 +1,31 @@
VERSION := 0.5.0
DIST := apt-mirror CHANGELOG LICENSE Makefile mirror.list postmirror.sh README.md .perltidyrc
BASE_PATH := /var/spool/apt-mirror
PREFIX ?= /usr/local
all:
dist: apt-mirror-$(VERSION).tar.xz
install:
install -m 755 -D apt-mirror $(DESTDIR)$(PREFIX)/bin/apt-mirror
mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1/
pod2man apt-mirror > $(DESTDIR)$(PREFIX)/share/man/man1/apt-mirror.1
install -m 644 -D mirror.list $(DESTDIR)/etc/apt/mirror.list
mkdir -p $(DESTDIR)$(BASE_PATH)/mirror
mkdir -p $(DESTDIR)$(BASE_PATH)/skel
mkdir -p $(DESTDIR)$(BASE_PATH)/var
%.tar.bz2: $(DIST)
tar -c --exclude-vcs --transform="s@^@$*/@" $^ | bzip2 -cz9 > $@
%.tar.gz: $(DIST)
tar -c --exclude-vcs --transform="s@^@$*/@" $^ | gzip -cn9 > $@
%.tar.xz: $(DIST)
tar -c --exclude-vcs --transform="s@^@$*/@" $^ | xz -cz9 > $@
clean:
rm -f *.tar.*
.PHONY: all clean dist install

@ -1,26 +0,0 @@
#!/bin/sh
BASE_PATH="/var/spool/apt-mirror"
echo "Installing apt-mirror command ...";
sudo cp apt-mirror /usr/local/bin/;
sudo chmod +x /usr/local/bin/apt-mirror;
echo "Installing apt-mirror configuration ...";
sudo mkdir -p /etc/apt/;
sudo cp mirror.list /etc/apt/;
echo "Installing apt-mirror manual ...";
sudo mkdir -p /usr/share/man/man1/
sudo pod2man apt-mirror > apt-mirror.1;
sudo mv apt-mirror.1 /usr/share/man/man1/;
echo "Creating base mirror structure ...";
sudo mkdir -p ${BASE_PATH}
sudo mkdir -p ${BASE_PATH}/mirror
sudo mkdir -p ${BASE_PATH}/skel
sudo mkdir -p ${BASE_PATH}/var
echo "Installing postmirror script example ...";
sudo cp postmirror.sh ${BASE_PATH}/var/
Loading…
Cancel
Save