Skip to content

Commit 499667e

Browse files
authored
Merge pull request #57 from oleludwig/make-uninstall
Fix make uninstall on BSD systems
2 parents 67d6892 + 96e85ed commit 499667e

File tree

2 files changed

+34
-10
lines changed

2 files changed

+34
-10
lines changed

.github/workflows/build-tests.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,16 @@ jobs:
199199
run: cd unittesting && nntp_address=${{ env.ipv4 }} ./run.sh
200200
- name: expect tests IPv6
201201
run: cd unittesting && nntp_address=${{ env.ipv6 }} ./run.sh
202+
- name: make uninstall
203+
run: docker exec testcontainer bash -c "make uninstall"
204+
- name: Check if directories/files are removed
205+
run: >
206+
docker exec testcontainer bash -c "
207+
if [ -d '/usr/local/sbin/wendzelnntpd' ]; then echo '/usr/local/sbin/wendzelnntpd still exists'; exit 1; fi
208+
&& if [ -d '/usr/local/sbin/wendzelnntpadm' ]; then echo '/usr/local/sbin/wendzelnntpadm still exists'; exit 1; fi
209+
&& if [ -d '/usr/local/sbin/create_certificate' ]; then echo '/usr/local/sbin/create_certificate still exists'; exit 1; fi
210+
&& if [ -d '/usr/local/share/wendzelnntpd/' ]; then echo '/usr/local/share/wendzelnntpd/ still exists'; exit 1; fi
211+
&& if [ -d '/usr/local/share/doc/wendzelnntpd/' ]; then echo '/usr/local/share/doc/wendzelnntpd/ still exists'; exit 1; fi"
202212
- name: Stop Docker container
203213
run: docker stop testcontainer -t 1
204214

@@ -413,3 +423,14 @@ jobs:
413423
run: cd unittesting && nntp_address=${{ env.ipv4 }} ./run.sh
414424
- name: expect tests IPv6
415425
run: cd unittesting && nntp_address=${{ env.ipv6 }} ./run.sh
426+
- name: make uninstall
427+
shell: vm {0}
428+
run: cd $GITHUB_WORKSPACE/ && make uninstall
429+
- name: Check if directories are removed
430+
shell: vm {0}
431+
run: |
432+
if [ -d '/usr/local/sbin/wendzelnntpd' ]; then echo '/usr/local/sbin/wendzelnntpd still exists'; exit 1; fi
433+
if [ -d '/usr/local/sbin/wendzelnntpadm' ]; then echo '/usr/local/sbin/wendzelnntpadm still exists'; exit 1; fi
434+
if [ -d '/usr/local/sbin/create_certificate' ]; then echo '/usr/local/sbin/create_certificate still exists'; exit 1; fi
435+
if [ -d "/usr/local/share/wendzelnntpd/" ]; then echo "/usr/local/share/wendzelnntpd/ still exists"; exit 1; fi
436+
if [ -d "/usr/local/share/doc/wendzelnntpd/" ]; then echo "/usr/local/share/doc/wendzelnntpd/ still exists"; exit 1; fi

Makefile.in

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ DEBUG=$(GDBON) -DDEBUG -DXXDEBUG
6565
# The list of documentation files we wish to install
6666
DOCFILES_TO_INST=AUTHORS CHANGELOG HISTORY README.md INSTALL LICENSE database/usenet.db_struct database/mysql_db_struct.sql
6767
MANPAGES=docs/wendzelnntpd.8 docs/wendzelnntpadm.8 docs/create_certificate.8
68-
HTML_DOC_DIRS=$(shell cd docs/ && find site/ -type d)
6968

7069
all : wendzelnntpadm main.o log.o database.o cdpstrings.o server.o lexyacc charstack.o libfunc.o acl.o db_abstraction.o hash.o $(SQLITEOBJ) $(MYSQLOBJ) $(POSTGRESOBJ) $(OPENSSLOBJ) globals.o scripts/startup/init.d_script create_certificate docs/create_certificate.8 wendzelnntpd.conf
7170
expr `cat build` \+ 1 >build
@@ -234,19 +233,23 @@ uninstall :
234233
# data files
235234
-rm -f $(DESTDIR)$(package_datadir)/openssl.cnf
236235
# documentation
237-
-cd $(DESTDIR)$(docdir)/ && rm -f $(notdir $(DOCFILES_TO_INST))
236+
-cd $(DESTDIR)$(docdir)/ && for f in $(DOCFILES_TO_INST); do \
237+
rm -f `basename $$f`; \
238+
done
238239
-rm -f $(DESTDIR)$(docdir)/docs.pdf
239240
-rm -rf $(DESTDIR)$(docdir)/site/
240241
# manpages
241-
-cd $(DESTDIR)$(man8dir) && rm -f $(notdir $(MANPAGES))
242+
-cd $(DESTDIR)$(man8dir) && for f in $(MANPAGES); do \
243+
rm -f `basename $$f`; \
244+
done
242245
# directories
243-
-rmdir --ignore-fail-on-non-empty $(DESTDIR)$(confdir)
244-
-rmdir --ignore-fail-on-non-empty $(DESTDIR)$(sbindir)
245-
-rmdir --ignore-fail-on-non-empty $(DESTDIR)$(package_datadir)
246-
-rmdir --ignore-fail-on-non-empty $(DESTDIR)$(docdir)
247-
-rmdir --ignore-fail-on-non-empty $(DESTDIR)$(man8dir)
248-
-rmdir --ignore-fail-on-non-empty $(DESTDIR)$(mandir)
249-
-rmdir --ignore-fail-on-non-empty $(DESTDIR)$(UDBDIR)
246+
-rmdir $(DESTDIR)$(confdir)
247+
-rmdir $(DESTDIR)$(sbindir)
248+
-rmdir $(DESTDIR)$(package_datadir)
249+
-rmdir $(DESTDIR)$(docdir)
250+
-rmdir $(DESTDIR)$(man8dir)
251+
-rmdir $(DESTDIR)$(mandir)
252+
-rmdir $(DESTDIR)$(UDBDIR)
250253
@echo
251254
@echo "Uninstall finished. Please note that the wendzelnntpd.conf (and possibly backups of it) and ssl certificates are left in place under $(DESTDIR)$(confdir)."
252255
@echo "The database (and possibly backups) and other user data like articles are also left in place under $(UDBDIR)."

0 commit comments

Comments
 (0)