Je l'ai fait de cette façon :
REMARQUE : veuillez lire attentivement, ne cassez pas votre système d'exploitation.
L'idée : récupérer les fichiers qui apparaissent après "make" (build). Puis rechercher ces fichiers sur le système et les supprimer.
Bibliographie :
Désinstaller les fichiers installés à partir d'une boule de tar du code source - nixCraft
- entered to source files of httpd-2.2/ folder.
# need to clean previous build, and get empty build files snapshot.
- make clean
# get empty build snapshot.
- find . print | tee make.b4
# build project.
- ./configure && make
# get files snapshot after build.
- find . print | tee make.after
# get difference before and after build.
- diff -y --suppress-common-lines make.b4 make.after | tee httpd_orig
# perform needed formatting.
- cat httpd_orig | column -t | tr -d '>' | tr -d ' ' | sponge httpd_orig
# get only files name.
- cat httpd_orig | xargs -n1 basename | tee httpd_orig_files
# get system files snapshot.
- find / \( -path /boot -o -path /dev -o -path /home -o -path /lost+find -o -path /media -o -path /mnt -o -path /proc -o -path /root -o -path /run -o -path /tmp -o -path /sys -o -path /var -o -path /opt \) -prune -o -type f -print | tee httpd_on_system
# run python script do remove files created on build project we find on system.
- python unistall.py
# File: uninstall.py
# Uninstall httpd 2.2 installed from source.
import os
# read file with build project files name.
with open("httpd_orig_files", "r") as f:
files = f.readlines()
httpd_orig = list()
for line in files:
# create a list of build files, strip remove newlines.
httpd_orig.append(line.strip())
# print files name from project build.
print httpd_orig
# open file with files paths on system.
with open("httpd_on_system", "r") as f:
httpd_files = f.readlines()
for hfile in httpd_files:
item = hfile.strip()
filename = os.path.basename(item).strip()
status = filename in httpd_orig
if status:
print "{:<10} {:50} {}".format(status, filename, item)
try:
# remove files from system.
os.remove(item)
except Exception as e:
print e