Skip to content

Commit 3cbbec9

Browse files
author
Kareem Zidane
committedMay 24, 2018
moved installation back to /usr/local, added post and postun
1 parent d5b5801 commit 3cbbec9

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed
 

‎Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,13 @@ rpm: $(LIBS) $(MANS)
9797
rm -rf build/rpm
9898

9999
# temporary fpm source
100-
mkdir -p build/rpm/libcs50/usr
101-
cp -r $(addprefix build/, include lib src) build/rpm/libcs50/usr
100+
mkdir -p build/rpm/libcs50/usr/local
101+
cp -r $(addprefix build/, include lib src) build/rpm/libcs50/usr/local
102102
mkdir -p build/rpm/libcs50/usr/local/share/man/man3
103103
cp -r $(MANS) build/rpm/libcs50/usr/local/share/man/man3
104104
fpm \
105+
--after-install post \
106+
--after-remove postun \
105107
--category libs \
106108
--chdir build/rpm/libcs50 \
107109
--description "CS50 library for C" \

‎post

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
3+
case "$1" in
4+
# initial installation or upgrade
5+
1|2)
6+
ldconfig /usr/local/lib
7+
;;
8+
esac

‎postun

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
case "$1" in
4+
# uninstallation
5+
0)
6+
ldconfig /usr/local/lib
7+
;;
8+
9+
# upgrade
10+
1)
11+
;;
12+
esac

0 commit comments

Comments
 (0)
Please sign in to comment.