diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 4d25230..d136b88 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -55,7 +55,7 @@ jobs: sudo make install sudo make uninstall make distclean - - name: Verify RHEL + SLES package creattion and installation + - name: Verify RHEL + SLES package creation and installation run: | docker build -f containers/Dockerfile.rhel -t localhost/cntlm-rpm-packaging:rhel . docker build -f containers/Dockerfile.sles -t localhost/cntlm-rpm-packaging:sles . diff --git a/Makefile.clang b/Makefile.clang index 6e4fd37..f1472d2 100644 --- a/Makefile.clang +++ b/Makefile.clang @@ -29,7 +29,7 @@ ifeq ($(DEBUG),1) CFLAGS += -g -O0 else # RELEASE - CFLAGS += -O3 + CFLAGS += -g -O3 endif ifneq ($(findstring CYGWIN,$(OS)),) @@ -82,22 +82,29 @@ win/resources.o: win/resources.rc @echo Win64: adding ICON resource @windres $^ -o $@ +ifneq ($(NOSTRIP),1) + STRIP="-s" + STRIPAIX="-S" +else + STRIP="" + STRIPAIX="-S" +endif install: $(NAME) # Special handling for install(1) if [ "`uname -s`" = "AIX" ]; then \ - install -M 755 -S -f $(BINDIR) $(NAME); \ + install -M 755 $(STRIPAIX) -f $(BINDIR) $(NAME); \ install -M 644 -f $(MANDIR)/man1 doc/$(NAME).1; \ install -M 600 -c $(SYSCONFDIR) doc/$(NAME).conf; \ elif [ "`uname -s`" = "Darwin" ]; then \ install -d $(BINDIR)/; \ - install -m 755 -s $(NAME) $(BINDIR)/$(NAME); \ + install -m 755 $(STRIP) $(NAME) $(BINDIR)/$(NAME); \ install -d $(MANDIR)/man1/; \ install -m 644 doc/$(NAME).1 $(MANDIR)/man1/$(NAME).1; \ [ -f $(SYSCONFDIR)/$(NAME).conf -o -z "$(SYSCONFDIR)" ] \ || install -d $(SYSCONFDIR)/; \ install -m 600 doc/$(NAME).conf $(SYSCONFDIR)/$(NAME).conf; \ else \ - install -D -m 755 -s $(NAME) $(BINDIR)/$(NAME); \ + install -D -m 755 $(STRIP) $(NAME) $(BINDIR)/$(NAME); \ install -D -m 644 doc/$(NAME).1 $(MANDIR)/man1/$(NAME).1; \ [ -f $(SYSCONFDIR)/$(NAME).conf -o -z "$(SYSCONFDIR)" ] \ || install -D -m 600 doc/$(NAME).conf $(SYSCONFDIR)/$(NAME).conf; \ @@ -131,15 +138,11 @@ deb: fi mv ../cntlm_$(VER)*.deb . -rpm: - sed -i "s/^\(Version:[\t ]*\)\(.*\)/\1$(VER)/g" rpm/cntlm.spec - if [ `id -u` = 0 ]; then \ - rpm/rules binary; \ - rpm/rules clean; \ - else \ - fakeroot rpm/rules binary; \ - fakeroot rpm/rules clean; \ - fi +rpm: tbz2 + sed -i "s/^\(Version:[\t ]*\)\(.*\)/\1$(VER)/g" rpm/SPECS/cntlm.spec + @cp $(NAME)-$(VER).tar.bz2 rpm/SOURCES/ + rpmbuild --define '_topdir $(CURDIR)/rpm' -ba rpm/SPECS/cntlm.spec + mv rpm/RPMS/**/*.rpm . win: win/setup.iss $(NAME) win/cntlm_manual.pdf win/cntlm.ini win/LICENSE.txt $(NAME)-$(VER)-win64.exe $(NAME)-$(VER)-win64.zip @@ -193,12 +196,10 @@ clean: distclean: clean ifeq ($(findstring CYGWIN,$(OS)),) - if [ `id -u` = 0 ]; then \ + if command -v dh_testdir && [ `id -u` = 0 ]; then \ debian/rules clean; \ - rpm/rules clean; \ - else \ + elif command -v dh_testdir; then \ fakeroot debian/rules clean; \ - fakeroot rpm/rules clean; \ fi endif @rm -f *.exe *.deb *.rpm *.tgz *.tar.gz *.tar.bz2 *.zip *.exe tags ctags pid 2>/dev/null