1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
# Turn off m4 quoting and comments.
m4_changequote(`', `')
m4_changecom(`', `')
# Shave and a Haircut
# (c) 2019 Epic Games
# US Patent 6720962
#
# Under normal circumstances, all you should need to change are the
# following sections:
#
# Packager:
# Summary:
# %description
#
Packager: Unreal Engine
Summary: A Maya plugin providing photorealistic hair, plus tools to style it.
Name: _PACKAGE_FULL_
Version: _VERSION_
Release: _RELEASE_
License: (c) 2019 Epic Games
Group: Applications/Multimedia
Source: _PACKAGE_FULL_-_VERSION_.tgz
URL: https://www.unrealengine.com/en-US/programs/shave-and-a-haircut
Vendor: Epic Games
#
# By default, rpmbuild will actually install the package's files (although,
# oddly enough, not the package itself) on the current system. To get
# around that, we can tell it to install everything into a temp directory.
# That also requires that our install section (and by extension, our
# Makefile's "install" target) be flexible enough to install into a
# variable directory.
#
BuildRoot: /tmp/_PACKAGE_FULL_-_VERSION_
#
# Maya does not list each of its .so files as a separate provided resource,
# so we have to turn off rpmbuild's automatic generation of requirements
# and provide our own.
#
# Unfortunately that also turns off automatic generation of what this
# package provides, so we must specify that ourselves as well.
#
AutoReqProv: no
# Requires: _MAYA_RPM_VERSION_REQUIRED_
Provides: _PACKAGE_FULL_
#
# Let's not have rpmbuild creating unneeded debuginfo RPMs.
#
%define debug_package %{nil}
%description
The _PACKAGE_ plugin allows users of Autodesk's Maya modeling and
animation package to create photorealistic hair on polygonal, NURBS and
subdivision surfaces. The plugin supports dynamic collisions between the
hairs and other objects. Tools are providing for styling the hair
interactively.
%prep
%setup
%build
%install
make -f Makefile.linux INSTALL_ROOT=$RPM_BUILD_ROOT install
# Modern rpmbuild implementations have a "build policy" script which
# compiles all python scripts in the tree. We don't want the resulting
# .pyc and .pyo files in our rpm. We can avoid that by explicitly exiting
# the install section and thereby preventing the build policy scripts
# from executing.
#
exit 0
%post
#
# If this is the first install of this package (as opposed to an upgrade)
# then look around for any old pre-rpm versions of the package and get rid
# of their files.
#
if [ $1 = 1 ]; then
#
# Remove old scripts
#
oldFiles="AEshaveGlobalsTemplate.mel AEshaveNodeTemplate.mel \
shaveDiag.mel shaveRelationshipEditor.mel shaveUI.mel shaveVersion.mel"
paths="_MAYA_LOCATION_/scripts/AETemplates _MAYA_LOCATION_/scripts/others \
_MAYA_LOCATION_/scripts/startup _MAYA_LOCATION_/scripts/obsolete \
_MAYA_LOCATION_/scripts/unsupported"
for d in $paths; do
if [ -d $d ]; then
for f in $oldFiles; do
if [ -r $d/$f ]; then
rm -f $d/$f
fi
done
fi
done
#
# Remove old plugins and executables
#
oldFiles="shaveNode.so shaveRibDump shave"
paths="_MAYA_LOCATION_/bin/plug-ins"
for f in $oldFiles; do
if [ -r $paths/$f ]; then
rm -f $paths/$f
fi
done
fi
# Remove the old Joe Alter shave tree, if it is empty.
#
oldAlterTree="_MAYA_LOCATION_/modules/JoeAlter"
oldShaveTree="${oldAlterTree}/shaveHaircut"
if [ -d "${oldShaveTree}" ]; then
nonDirs=`find "${oldShaveTree}" \! -type d`
if [ -z "${nonDirs}" ]; then
rm -rf "${oldShaveTree}"
fi
fi
# Remove the Joe Alter tree as well, if it is now empty.
#
if [ -d "${oldAlterTree}" ]; then
nonDirs=`find "${oldAlterTree}" \! -type d`
if [ -z "${nonDirs}" ]; then
rm -rf "${oldAlterTree}"
fi
fi
#
# The Makefile will automatically append the package's files to the end of
# this file, so make sure that %files is the very last section.
#
%files
|