Basically I want my build process to do this:
- Run a shell script that strips data from csv files and combines them into a single csv.
- The resulting csv output from that script is then packaged in the rpm.
- When rpm -install is run, the csv file (not the script) is placed in a specific location on the target machine.
I'm very new to RPM so I'm sorry if I've made a blunder with the code below, but it gives me several errors when trying to build or install.
I attempted to run a script from the sources directory
I'm a little confused on how the expected flow of rpm should work. In testing, I'm building and installing on the same machine, but in practice it will be on two machines.
When I run the code below, does it put a copy of my source files into the .rpm file? I'm wondering why it doesn't work. (it says process.sh does not exist)
Name: Test
Version: 1
Release: 1
Summary: Test
License: FIXME
%description
this is a test build
%prep
echo "BUILDROOT = $RPM_BUILD_ROOT"
mkdir -p -m777 $RPM_BUILD_ROOT/usr/local/bin/
cp /home/myuser/foo/util/* $RPM_BUILD_ROOT/usr/local/bin
cd $RPM_BUILD_ROOT/usr/local/bin/
./process.sh hosts.csv processed.csv
exit
%files
%attr(0777, root, root) /foo/processed.csv