jw-pkg/make/smart-selection.mk

71 lines
2.1 KiB
Makefile
Raw Normal View History

2006-09-14 15:04:48 +00:00
# === variable definitions
GET_OS_SH = sh $(MOD_SCRIPT_DIR)/get-os.sh
GENERATE_SELECTION = sh $(MOD_SCRIPT_DIR)/generate_selection.sh
UPLOAD_SH = sh $(MOD_SCRIPT_DIR)/upload.sh
2006-09-14 15:04:48 +00:00
DISTRIBUTOR = $(shell $(GET_OS_SH) | cut -d- -f1)
DISTRO_RELEASE = $(shell $(GET_OS_SH) | cut -d- -f2-)
UPLOAD_URL = root@ftp.jannet.de:/srv/ftp/pub/packages/linux/$(DISTRIBUTOR)/$(DISTRO_RELEASE)/setup/descr
SELECTION = $(shell $(GENERATE_SELECTION) -s)-packages.txt
CHANNEL_LIST = $(shell $(GENERATE_SELECTION) -s)-channels.txt
2006-09-14 15:04:48 +00:00
# === targets
all: selection.done channels.done
install:
2006-09-14 15:04:48 +00:00
clean:
$(RM) -rf *.done *.tmp
2006-09-14 15:04:48 +00:00
distclean: clean
upload: upload.done
2006-09-14 15:04:48 +00:00
install-smart: rpm-install-smart.done
2006-09-14 15:53:46 +00:00
commit: selection.done channels.done
cvs add $(SELECTION) $(CHANNEL_LIST) || exit 0
2006-09-14 15:53:46 +00:00
cvs commit -m "o updated by target $@"
smart-update: smart-update.done
smart-config: smart-config.done
2006-10-24 09:33:08 +00:00
write: selection.done channels.done
include $(MODDIR)/make/defs.mk
2006-09-14 15:04:48 +00:00
# === rules
selection.done: $(MODDIR)/make/smart-selection.mk
rpm -qa --queryformat '%{NAME}\n' | sort -u | \
2012-02-04 10:59:02 +00:00
$(SED) '/gpg-pubkey/ d' > $(SELECTION).tmp
mv $(SELECTION).tmp $(SELECTION)
touch $@
channels.done: $(MODDIR)/make/smart-selection.mk
2012-02-04 10:59:02 +00:00
smart channel --show | $(SED) '/\[rpm-sys\]/,+3 d' > $(CHANNEL_LIST)
2006-09-14 15:04:48 +00:00
touch $@
upload.done: selection.done
2006-09-14 15:04:48 +00:00
sh $(UPLOAD_SH) $(SELECTION) $(CHANNEL_LIST) $(UPLOAD_URL)
2007-12-19 20:52:10 +00:00
$(CVS_RSH) -l root ftp.jannet.de $(UPDATE_REPO_SH)
touch $@
rpm-install-smart.done:
if ! rpm -q smart >/dev/null 2>&1 ; then \
wget ftp.jannet.de:/pub/packages/linux/$(DISTRIBUTOR)/$(DISTRO_RELEASE)/rpm/i686/smart.rpm; \
sudo rpm -U smart.rpm; \
sudo smart update; \
sudo smart channel --remove-all; \
fi
touch $@
smart-update.done:
sudo smart update || exit 0
touch $@
%-packages.txt-install: smart-update.done
2012-02-04 11:06:22 +00:00
$(CAT) $*-packages.txt | xargs sudo smart install -y
%-channels.txt-replace:
sudo smart channel -y --remove-all
sudo smart channel -y --add $*-channels.txt
sudo smart update || exit 0
2006-09-14 15:53:46 +00:00
smart-config.done:
sudo smart config --set rpm-check-signatures=false
sudo smart config --set remove-packages=false
touch $@