- @make clobber
-# verify that i'm root needs to be done
- rm -f ../ijbswa.tar.gz
-# verify all version strings, FLAGS, etc. in the spec file
- cat junkbuster-rh.spec | sed 's/^Version:.*/Version: $(RPM_VERSION)/g' | sed 's/^Release:.*/Release: $(RPM_PACKAGEV)/g' > abc && mv -f abc junkbuster-rh.spec
- tar --exclude "CVS" --exclude "junkbuster-suse.spec" -cvzf ../ijbswa.tar.gz .
-# verify all files in their correct location needs to be done
- cd .. && rpm -ta ijbswa.tar.gz
+ @for dir in RPMS SRPMS BUILD SOURCES SPECS; do \
+ if [ ! -w $(RPM_BASE)/$$dir ]; then \
+ $(ECHO) "$(RPM_BASE)/$$dir is not writable for you. Maybe try as root."; \
+ exit; \
+ fi; \
+ done ; \
+ $(MAKE) clobber; \
+ [ -f $(TAR_ARCH) ] && $(RM) $(TAR_ARCH); \
+ $(CAT) junkbuster-rh.spec | \
+ $(SED) 's/^Version:.*/Version: $(RPM_VERSION)/g;s/^Release:.*/Release: $(RPM_PACKAGEV)/g' > abc && \
+ $(MV) -f abc junkbuster-rh.spec; \
+ $(TAR) --exclude "CVS" --exclude "junkbuster-suse.spec" -cvzf $(TAR_ARCH) . ; \
+ $(RPM) -ta $(TAR_ARCH); \
+ [ -f $(TAR_ARCH) ] && $(RM) $(TAR_ARCH)
+
+#
+# anonymously ncftps the rpms to sourceforge
+#
+redhat-upload:
+ ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming $(RPM_BASE)/SRPMS/junkbuster-$(RPM_VERSION)-$(RPM_PACKAGEV).src.rpm
+# better should use `arch` here instead of ix86 to support other platforms too
+ ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming $(RPM_BASE)/RPMS/*/junkbuster-$(RPM_VERSION)-$(RPM_PACKAGEV).*.rpm
+ @$(ECHO) -------------------------------------------------------
+ @$(ECHO) Now goto
+ @$(ECHO) http://sourceforge.net/project/admin/editpackages.php?group_id=11118
+ @$(ECHO) ... and release the files.
+ @$(ECHO) -------------------------------------------------------
+ # w3m http://sourceforge.net/project/admin/editpackages.php?group_id=11118