[Home]

Summary:ASTERISK-09467: [Patch] make uninstall
Reporter:Andrew Latham (lathama)Labels:
Date Opened:2007-05-17 19:40:25Date Closed:2007-06-05 14:56:02
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) uninstall_zaptel.diff
( 1) uninstall.diff
Description:Add make uninstall so that zaptel can be completely uninstalled.  Intended at uninstall without reinstall afterword.

****** ADDITIONAL INFORMATION ******

Patch might need some tweaking but the idea is sound.
Comments:By: Tzafrir Cohen (tzafrir) 2007-05-23 21:15:14

Generally looks good.

One comment:

Why not use:

rm -f $(INSTALL_PREFIX)/somefile

instead of:

if [ -f $(INSTALL_PREFIX)/somefile ]; then \
 rm -f $(INSTALL_PREFIX)/somefile ; \
fi

By: Andrew Latham (lathama) 2007-05-23 21:18:29

Sure that would work, I just wanted a way to uninstall without reading the Makefile and deleting all the installed files and folders.

By: Andrew Latham (lathama) 2007-05-29 14:27:49

+++ Makefile    2007-05-29 10:18:05.000000000 -0400
@@ -491,6 +491,17 @@
      done;
endif

+uninstall: uninstall-modules uninstall-hotplug
+       rm -rf $(INSTALL_PREFIX)/usr/share/zaptel \
+       rm -rf $(INSTALL_PREFIX)/usr/include/zaptel; \
+       rm -f $(INSTALL_PREFIX)/sbin/ztcfg \
+       rm -f $(INSTALL_PREFIX)/sbin/sethdlc; \
+       rm -f $(INSTALL_PREFIX)/sbin/zttool; \
+       mv $(INSTALL_PREFIX)/etc/zaptel.conf
$(INSTALL_PREFIX)/etc/zaptel.`date +%F` \
+       rm -f $(INSTALL_PREFIX)/etc/hotplug/usb/xpp*; \
+       rm -f $(INSTALL_PREFIX)/etc/udev/rules.d/zaptel.rules; \
+       rm -f $(INSTALL_PREFIX)/etc/udev/rules.d/xpp.rules;
+
install-modules: $(INSTALL_MODULES) uninstall-modules
ifeq ($(BUILDVER),linux24)
      $(INSTALL) -d $(MOD_DIR)

By: Andrew Latham (lathama) 2007-05-29 15:14:52

Suggested Makefile guidelines for all projects, for detailed ides google for "makefile standards"

Makefile
* Variables
   Directory
     prefix
       Install directory prefix
   Command

* Targets
   all or default
     Compile complete program
   clean
     Clean the source code from compiled files.  
     Brings the source code back to a known state.
   install
     Install compiled programs to final location and supporting files.
   update
     Get source code update
   uninstall
     Uninstall installed programs and supporting files

By: Tzafrir Cohen (tzafrir) 2007-06-05 14:05:58

Added a patch that does basically what you wanted in the comment.

What are the targets 'uninstall-modules' and 'uninstall-hotplug'? to be written?

By: Andrew Latham (lathama) 2007-06-05 14:12:46

uninstall-modules and uninstall-hotplug are already in the makefile

By: Andrew Latham (lathama) 2007-06-05 14:30:42

upon closer looking I notice that the uninstall-modules uninstall-hotplug are not needed for the unistall or is redundant

By: Tzafrir Cohen (tzafrir) 2007-06-05 14:47:20

Adapted uninstall.diff: Got rid of those unrequired dependencies.

By: Tzafrir Cohen (tzafrir) 2007-06-05 14:55:29

Patch committed to trunk rev. 2571 .