# === 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 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 # === targets all: selection.done channels.done install: clean: $(RM) -rf *.done *.tmp distclean: clean upload: upload.done install-smart: rpm-install-smart.done commit: selection.done channels.done cvs add $(SELECTION) $(CHANNEL_LIST) || exit 0 cvs commit -m "o updated by target $@" smart-update: smart-update.done smart-config: smart-config.done write: selection.done channels.done include $(MODDIR)/make/defs.mk # === rules selection.done: $(MODDIR)/make/smart-selection.mk rpm -qa --queryformat '%{NAME}\n' | sort -u | \ $(SED) '/gpg-pubkey/ d' > $(SELECTION).tmp mv $(SELECTION).tmp $(SELECTION) touch $@ channels.done: $(MODDIR)/make/smart-selection.mk smart channel --show | $(SED) '/\[rpm-sys\]/,+3 d' > $(CHANNEL_LIST) touch $@ upload.done: selection.done sh $(UPLOAD_SH) $(SELECTION) $(CHANNEL_LIST) $(UPLOAD_URL) $(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 $(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 smart-config.done: sudo smart config --set rpm-check-signatures=false sudo smart config --set remove-packages=false touch $@