Sophie

Sophie

distrib > Fedora > 20 > i386 > by-pkgid > 3d69aad1003eba8cb386febba33e8ecf > files > 1

openclipart-2.0-3.fc20.src.rpm

#!/bin/bash

# Quit out if anything fails.
set -e

if [ -d cleandir ]; then
   echo "please remove cleandir before proceeding"
   exit 0
else
   echo "making cleandir for processing..."
   mkdir cleandir
fi

cd cleandir

extension="${1#*.}"
basefilename="${1%.*}"
basefilename="${basefilename%.*}"

echo "unpacking $1 into cleandir..."
tar xf ../$1

cd openclipart-*-svgonly

# Delete the non-free files.

# These files are CC-BY-NC-SA

for i in \
BHSPitMonkey \
SRD/SRD_Bundle_of_Hearts.svg \
antontw/antontw_Monkey.svg \
artfloid \
bsantos/bsantos_No_respect_for_pedestrians.svg \
dniezby/dniezby_Film_reel.svg \
dniezby/dniezby_Pencil_10.svg \
dniezby/dniezby_Pencil_11.svg \
dniezby/dniezby_Pencil_12.svg \
dniezby/dniezby_Pencil_13.svg \
dniezby/dniezby_Reflected_Scene_Slate.svg \
dniezby/dniezby_Scene_Slate.svg \
fejack/fejack_2009_calendar.svg \
hyoga/hyoga_Chile.svg \
klepas/klepas_Movie_night_ticket.svg \
nodanero \
pbhj/pbhj_this_class_is_FULL_sorry.svg \
rugby471/rugby471_Tango_Style_Cheese_Wheel.svg \
worms_x/worms_x_French_butter_croissant.svg ;
do
echo "deleting CC-BY-SA-NC clipart/$i";
rm -rf clipart/$i;
done

# These files are CC-BY-NC

for j in \
Spidge \
da5id1/da5id1_Mouse.svg \
da5id1/da5id1_Mouse_1.svg \
gabriel \
massimo/massimo_El_mulo_loco.svg \
nthiagaraj \
pvalencia/pvalencia_Manzana.svg \
sigalaflecha/sigalaflecha_m_sico_hopi.svg \
pbhj/pbhj_creating_an_oval_vignette.svg;
do
echo "deleting CC-BY-NC clipart/$j";
rm -rf clipart/$j;
done

# These files are very likely trademark infringing.
for k in \
KeyBlader30 \
El_Sato/El_Sato_Tux_The_penguin_in_sonic_style.svg;
do
echo "deleting questionable file clipart/$k";
rm -rf clipart/$k;
done

# okay, make the clean tarball
cd ..

tar cfj ../$basefilename-clean.tar.bz2 *

# now, nuke the tempdir
cd ..
rm -rf cleandir