Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
.vscode/
.coverage.html

# Packaging
packaging/unix/usr/share/icons/
packaging/unix/usr/share/pixmaps/
deb/
2 changes: 1 addition & 1 deletion config/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (c *Config) InitNginx() error {
"\n!!! Please add the following include directive to http section of your nginx.conf file located at %s like this:\n",
filepath.Join(c.nginxConfigDir, "..", "nginx.conf"),
)
fmt.Printf("\nhttp {\n\t...\n\n\t%s\n}\n", "include /usr/share/spinup/config/nginx/*.conf;")
fmt.Printf("\nhttp {\n\t...\n\n\t%s\n}\n", "include /etc/spinup/config/nginx/**/*.conf;")
}

return nil
Expand Down
13 changes: 8 additions & 5 deletions packaging/DEBIAN/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ fi
#####################

# Create the spinup directory if it doesn't exist
mkdir -p /usr/share/spinup
mkdir -p /etc/spinup

# Create the config directory if it doesn't exist
mkdir -p /etc/spinup/config

# Remove the old symlink if it exists and create a new one
rm -f /usr/bin/spinup
ln -s /usr/share/spinup/bin/spinup /usr/bin/spinup
ln -s /etc/spinup/bin/spinup /usr/bin/spinup

# Set the correct permissions on the spinup directory
chown -R root:root /usr/share/spinup
chown -R root:root /etc/spinup

###############
### Dnsmasq ###
Expand All @@ -39,15 +42,15 @@ mkdir -p /etc/dnsmasq.d
# Check if the spinup.conf already exists in the dnsmasq.d directory
if [ ! -f /etc/dnsmasq.d/spinup.conf ]; then
# Link the dnsmasq configuration file for spinup to the dnsmasq.d directory if it doesn't exist
ln -s /usr/share/spinup/config/dnsmasq.conf /etc/dnsmasq.d/spinup.conf
ln -s /etc/spinup/config/dnsmasq.conf /etc/dnsmasq.d/spinup.conf
fi

#############
### Nginx ###
#############

USER_SPINUP_NGINX_DIR="$USER_HOME/.config/spinup/nginx"
SPINUP_NGINX_DIR="/usr/share/spinup/config/nginx"
SPINUP_NGINX_DIR="/etc/spinup/config/nginx"

# Create the user's spinup nginx directory if it doesn't exist
mkdir -p $USER_SPINUP_NGINX_DIR
Expand Down
4 changes: 2 additions & 2 deletions packaging/DEBIAN/postrm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fi
rm -f /usr/bin/spinup

# Remove the spinup directory
rm -rf /usr/share/spinup
rm -rf /etc/spinup

# Remove the link to the dnsmasq configuration file
rm -f /etc/dnsmasq.d/spinup.conf
Expand All @@ -19,7 +19,7 @@ rm -f /etc/dnsmasq.d/spinup.conf
systemctl restart dnsmasq

# Remove include directive in the nginx configuration file
sed -i '/include \/usr\/share\/spinup\/config\/nginx\/\*.conf;/d' /etc/nginx/nginx.conf
sed -i '/include \/etc\/spinup\/config\/nginx\/\*.conf;/d' /etc/nginx/nginx.conf

# Restart the nginx service
systemctl restart nginx
Expand Down
14 changes: 7 additions & 7 deletions packaging/rpmbuild/SPECS/spinup.spec
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@ Quickly spin up your multi command projects.
%setup -q

%install
mkdir -p %{buildroot}/usr/share/spinup/bin
cp %{_builddir}/%{name}-%{version}/%{name} %{buildroot}/usr/share/spinup/bin
cp %{_builddir}/%{name}-%{version}/postinst %{buildroot}/usr/share/spinup/bin/postinst
mkdir -p %{buildroot}/etc/spinup/bin
cp %{_builddir}/%{name}-%{version}/%{name} %{buildroot}/etc/spinup/bin
cp %{_builddir}/%{name}-%{version}/postinst %{buildroot}/etc/spinup/bin/postinst
cp -r %{_builddir}/%{name}-%{version}/etc %{buildroot}
cp -r %{_builddir}/%{name}-%{version}/usr %{buildroot}

%post
sh /usr/share/spinup/bin/postinst
sh /etc/spinup/bin/postinst

%clean
rm -rf %{buildroot}

%files
/usr/share/spinup/bin/%{name}
/usr/share/spinup/bin/postinst
/etc/spinup/bin/%{name}
/etc/spinup/bin/postinst
/etc/spinup/config/dnsmasq.conf
/etc/sudoers.d/spinup
/usr/share/applications/spinup-app.desktop
/usr/share/spinup/config/dnsmasq.conf
/usr/share/icons/hicolor/1024x1024/apps/spinup.png
/usr/share/icons/hicolor/128x128/apps/spinup.png
/usr/share/icons/hicolor/128x128@2x/apps/spinup.png
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Spinup configuration file for dnsmasq
#########################################
# Spinup configuration file for dnsmasq #
#########################################

# Require requests to have an actual domain unless specified in /etc/hosts
domain-needed
Expand Down
2 changes: 1 addition & 1 deletion packaging/unix/usr/share/applications/spinup-app.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Name=Spinup
Comment=Quickly spin up your multi command projects.
GenericName=Development Environment
Exec=/usr/share/spinup/bin/spinup
Exec=/usr/bin/spinup
Icon=spinup
Type=Application
StartupNotify=false
Expand Down
5 changes: 3 additions & 2 deletions scripts/release/package-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ SPINUP_VERSION=$(cat ./common/.version | sed 's/^v//')
for os_version in "" "-ubuntu24.04"; do
# Create the directory structure for the .deb package
mkdir -p deb/spinup-${SPINUP_VERSION}${os_version}/DEBIAN
mkdir -p deb/spinup-${SPINUP_VERSION}${os_version}/usr/share/spinup/bin
mkdir -p deb/spinup-${SPINUP_VERSION}${os_version}/etc/spinup/bin

# Copy the necessary files to the .deb package directory
cp build/bin/spinup-${SPINUP_VERSION}${os_version} deb/spinup-${SPINUP_VERSION}${os_version}/usr/share/spinup/bin/spinup
cp build/bin/spinup-${SPINUP_VERSION}${os_version} deb/spinup-${SPINUP_VERSION}${os_version}/etc/spinup/bin/spinup
cp packaging/DEBIAN/* deb/spinup-${SPINUP_VERSION}${os_version}/DEBIAN
cp -r packaging/unix/usr deb/spinup-${SPINUP_VERSION}${os_version}
cp -r packaging/unix/etc deb/spinup-${SPINUP_VERSION}${os_version}

# Update the control file with the current version number
echo -e "\nVersion: $SPINUP_VERSION" >> deb/spinup-${SPINUP_VERSION}${os_version}/DEBIAN/control
Expand Down
2 changes: 1 addition & 1 deletion scripts/release/package-macos-zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ mkdir -p "$MAC_OS_DIR$SPINUP_SHARE_DIR"

# Copy the contents of the build/unix directory to the MacOS directory
cp -r "./packaging/unix/etc/." $MAC_OS_DIR/etc
cp -r "./packaging/unix/usr/share/spinup/." $MAC_OS_DIR$SPINUP_SHARE_DIR
cp -r "./packaging/unix/etc/spinup/." $MAC_OS_DIR$SPINUP_SHARE_DIR

# Copy the binary file to the MacOS directory
mkdir -p "$MAC_OS_DIR$SPINUP_SHARE_DIR/bin"
Expand Down