Skip to content

Commit 4cae11e

Browse files
committed
Fix uninstall script in FreeBSD
1 parent 47ed18c commit 4cae11e

6 files changed

Lines changed: 27 additions & 7 deletions

configure-freebsd.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ cp mk/install.sh.freebsd.template mk/install.sh
152152
sed -i.bak "s|{{INSTALL_DIR}}|$INSTALL_DIR|g" mk/install.sh && rm mk/install.sh.bak
153153
chmod +x mk/install.sh
154154

155-
cp mk/uninstall.sh.template mk/uninstall.sh
155+
cp mk/uninstall.sh.freebsd.template mk/uninstall.sh
156156
sed -i.bak "s|{{INSTALL_DIR}}|$INSTALL_DIR|g" mk/uninstall.sh && rm mk/uninstall.sh.bak
157-
chmod +x mk/install.sh
157+
chmod +x mk/uninstall.sh
158158

159159
echo "PcapPlusPlus configuration is complete. Files created (or modified): $PLATFORM_MK, $PCAPPLUSPLUS_MK", mk/install.sh, mk/uninstall.sh

configure-linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ chmod +x mk/install.sh
339339

340340
cp mk/uninstall.sh.template mk/uninstall.sh
341341
sed -i.bak "s|{{INSTALL_DIR}}|$INSTALL_DIR|g" mk/uninstall.sh && rm mk/uninstall.sh.bak
342-
chmod +x mk/install.sh
342+
chmod +x mk/uninstall.sh
343343

344344

345345
# finished setup script

configure-mac_os_x.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,6 @@ chmod +x mk/install.sh
161161

162162
cp mk/uninstall.sh.template mk/uninstall.sh
163163
sed -i.bak "s|{{INSTALL_DIR}}|$INSTALL_DIR|g" mk/uninstall.sh && rm mk/uninstall.sh.bak
164-
chmod +x mk/install.sh
164+
chmod +x mk/uninstall.sh
165165

166166
echo "PcapPlusPlus configuration is complete. Files created (or modified): $PLATFORM_MK, $PCAPPLUSPLUS_MK", mk/install.sh, mk/uninstall.sh

mk/install.sh.freebsd.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ echo 'Description: a multiplatform C++ network sniffing and packet parsing and c
3434
printf 'Version: '>>PcapPlusPlus.pc
3535
grep '#define PCAPPLUSPLUS_VERSION ' header/PcapPlusPlusVersion.h | cut -d " " -f3 | tr -d "\"" | tr -d '\n'>>PcapPlusPlus.pc
3636
printf '\n'>>PcapPlusPlus.pc
37-
echo 'URL: https://seladb.github.io/PcapPlusPlus-Doc'>>PcapPlusPlus.pc
37+
echo 'URL: https://pcapplusplus.github.io'>>PcapPlusPlus.pc
3838
printf 'Libs: '>>PcapPlusPlus.pc
3939
grep PCAPPP_LIBS PcapPlusPlus.mk | cut -d " " -f3- | tr -d '\r' | tr '\n' ' '>>PcapPlusPlus.pc
4040
printf '\nCFlags: '>>PcapPlusPlus.pc
@@ -46,6 +46,6 @@ mkdir -p $INSTALL_DIR/etc
4646
mv PcapPlusPlus.mk $INSTALL_DIR/etc
4747

4848
# copy PcapPlusPlus.pc
49-
PKG_CONFIG_PATH="${PKG_CONFIG_PATH:-$INSTALL_DIR/lib/pkgconfig}"
49+
PKG_CONFIG_PATH="${PKG_CONFIG_PATH:-$INSTALL_DIR/libdata/pkgconfig}"
5050
mkdir -p $PKG_CONFIG_PATH
5151
mv PcapPlusPlus.pc $PKG_CONFIG_PATH

mk/install.sh.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ echo 'Description: a multiplatform C++ network sniffing and packet parsing and c
3434
printf 'Version: '>>PcapPlusPlus.pc
3535
grep '#define PCAPPLUSPLUS_VERSION ' header/PcapPlusPlusVersion.h | cut -d " " -f3 | tr -d "\"" | tr -d '\n'>>PcapPlusPlus.pc
3636
printf '\n'>>PcapPlusPlus.pc
37-
echo 'URL: https://seladb.github.io/PcapPlusPlus-Doc'>>PcapPlusPlus.pc
37+
echo 'URL: https://pcapplusplus.github.io'>>PcapPlusPlus.pc
3838
printf 'Libs: '>>PcapPlusPlus.pc
3939
grep PCAPPP_LIBS PcapPlusPlus.mk | cut -d " " -f3- | tr -d '\r' | tr '\n' ' '>>PcapPlusPlus.pc
4040
printf '\nCFlags: '>>PcapPlusPlus.pc

mk/uninstall.sh.freebsd.template

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/local/bin/bash
2+
set -e # Exit with nonzero exit code if anything fails
3+
4+
INSTALL_DIR={{INSTALL_DIR}}
5+
6+
# remove libs
7+
rm -f $INSTALL_DIR/lib/libCommon++.a $INSTALL_DIR/lib/libPacket++.a $INSTALL_DIR/lib/libPcap++.a
8+
9+
# remove header files
10+
rm -rf $INSTALL_DIR/include/pcapplusplus
11+
12+
# remove examples
13+
for f in examples/*; do rm -f $INSTALL_DIR/bin/$(basename "$f"); done
14+
15+
# remove template makefile
16+
rm -f $INSTALL_DIR/etc/PcapPlusPlus.mk
17+
18+
# remove PcapPlusPlus.pc
19+
PKG_CONFIG_PATH="${PKG_CONFIG_PATH:-$INSTALL_DIR/libdata/pkgconfig}"
20+
rm -f $PKG_CONFIG_PATH/PcapPlusPlus.pc

0 commit comments

Comments
 (0)