1 | Name: ldraw_parts |
---|
2 | Version: 201302 |
---|
3 | Release: ec4 |
---|
4 | # Downloaded from http://www.ldraw.org/library/updates/complete.zip |
---|
5 | Source0: ldraw-parts-library-complete-2013-02.zip |
---|
6 | Source1: mklist.py |
---|
7 | Group: Engineering/CAD |
---|
8 | Summary: LDRAW parts library |
---|
9 | License: CCAL 2.0 |
---|
10 | BuildArch: noarch |
---|
11 | Buildroot: /tmp/%{name}-%{version}-root |
---|
12 | |
---|
13 | %package creativecommons |
---|
14 | Summary: LDRAW parts library, Creative Commons parts |
---|
15 | License: CCAL 2.0 |
---|
16 | Group: Engineering/CAD |
---|
17 | Requires: ldraw_parts |
---|
18 | |
---|
19 | %package models |
---|
20 | Summary: LDRAW parts library, example models |
---|
21 | License: CCAL 2.0 |
---|
22 | Group: Engineering/CAD |
---|
23 | Requires: ldraw_parts |
---|
24 | |
---|
25 | |
---|
26 | %description |
---|
27 | LDRAW parts library |
---|
28 | %description models |
---|
29 | LDRAW parts library example models |
---|
30 | %description creativecommons |
---|
31 | LDRAW parts library (creativecommons) |
---|
32 | #%description nonredist |
---|
33 | #LDRAW parts library (non-redistributable) |
---|
34 | |
---|
35 | %prep |
---|
36 | rm -rf $RPM_BUILD_DIR/ldraw |
---|
37 | unzip %{SOURCE0} |
---|
38 | |
---|
39 | %build |
---|
40 | cd ldraw |
---|
41 | find -name \*.dat | xargs grep -l "LICENSE Redistributable under CCAL" | sed 's;^.;/usr/share/ldraw/;' > ../ldraw-cc-parts |
---|
42 | find -name \*.dat | xargs grep -l "LICENSE Not redistributable" | sed 's;^.;/usr/share/ldraw/;' > ../ldraw-nr-parts |
---|
43 | if [ $(wc -l < ../ldraw-nr-parts) -ne 0 ]; then |
---|
44 | # If there are any non-redistributable parts, the source rpm won't be |
---|
45 | # redistributable either. But as of 2013, all the non-redistributable |
---|
46 | # parts had been replaced. |
---|
47 | echo "Non-redistributable parts found; aborting build." >&2 |
---|
48 | exit 1 |
---|
49 | fi |
---|
50 | |
---|
51 | %install |
---|
52 | rm -rf $RPM_BUILD_ROOT |
---|
53 | mkdir -p $RPM_BUILD_ROOT/usr/share |
---|
54 | cp -r ldraw $RPM_BUILD_ROOT/usr/share/ |
---|
55 | |
---|
56 | mkdir -p $RPM_BUILD_ROOT/usr/bin |
---|
57 | cp %{SOURCE1} $RPM_BUILD_ROOT/usr/bin/ |
---|
58 | |
---|
59 | rm $RPM_BUILD_ROOT/usr/share/ldraw/NonCAreadme.txt |
---|
60 | rm $RPM_BUILD_ROOT/usr/share/ldraw/models/Note*NonCA.txt |
---|
61 | # Allow for applications using different capitalization |
---|
62 | ln -s LDConfig.ldr $RPM_BUILD_ROOT/usr/share/ldraw/ldconfig.ldr |
---|
63 | # no need for the exe or the C implementation |
---|
64 | rm $RPM_BUILD_ROOT/usr/share/ldraw/mklist*.{zip,exe} |
---|
65 | |
---|
66 | %postun creativecommons |
---|
67 | /usr/bin/mklist.py /usr/share/ldraw > /usr/share/ldraw/parts.lst |
---|
68 | |
---|
69 | %post creativecommons |
---|
70 | /usr/bin/mklist.py /usr/share/ldraw > /usr/share/ldraw/parts.lst |
---|
71 | |
---|
72 | %files -f ldraw-cc-parts creativecommons |
---|
73 | /usr/share/ldraw/CA*.txt |
---|
74 | /usr/share/ldraw/models/Note*[0-9]CA*.txt |
---|
75 | |
---|
76 | %files models |
---|
77 | /usr/share/ldraw/models/car.dat |
---|
78 | /usr/share/ldraw/models/pyramid.dat |
---|
79 | /usr/share/ldraw/models/note*.txt |
---|
80 | %files |
---|
81 | %attr(755, root, root) /usr/bin/mklist.py |
---|
82 | #%attr(755, root, root) /usr/bin/mklist.pyc |
---|
83 | #%attr(755, root, root) /usr/bin/mklist.pyo |
---|
84 | /usr/share/ldraw/LDConfig.ldr |
---|
85 | /usr/share/ldraw/ldconfig.ldr |
---|
86 | /usr/share/ldraw/LDCfgalt.ldr |
---|
87 | /usr/share/ldraw/LDConfig_TLG.ldr |
---|
88 | /usr/share/ldraw/Readme.txt |
---|