feat: improve installation system with user-local and system-wide options

Update justfile installation system to provide better user experience:

Installation Improvements:
- `just install` - installs to ~/bin (user-local, no sudo required)
- `just system-install` - installs to /usr/local/bin (system-wide, requires sudo)
- `just uninstall` - removes from ~/bin
- `just system-uninstall` - removes from /usr/local/bin (requires sudo)

Benefits:
- User-local installation by default (follows Unix best practices)
- No sudo required for personal installations
- Clear separation between user and system installs
- Easy uninstallation for both scenarios
- Helpful PATH reminder for ~/bin installation

Documentation Updates:
- Update CLAUDE.md with new installation commands
- Update IMPLEMENTATION_COMPARISON.md deployment examples
- Include uninstall instructions for both methods

This follows modern software distribution practices where user-local
installation is preferred for development tools, with system-wide
installation available when needed for shared environments.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ole-Morten Duesund 2025-08-03 19:05:30 +02:00
commit cf41a8c1c5
3 changed files with 44 additions and 10 deletions

View file

@ -23,8 +23,17 @@ just build-rust # Builds rust/target/release/mail2couch-rs
# Build optimized release versions # Build optimized release versions
just build-release just build-release
# Install both binaries to /usr/local/bin # Install both binaries to ~/bin (user-local)
sudo just install just install
# Install both binaries to /usr/local/bin (system-wide)
sudo just system-install
# Uninstall from ~/bin
just uninstall
# Uninstall from /usr/local/bin
sudo just system-uninstall
# Run tests for both implementations # Run tests for both implementations
just test just test

View file

@ -493,13 +493,13 @@ export MAIL2COUCH_LOG_FORMAT=json
### Universal Installation ### Universal Installation
```bash ```bash
# Build and install both implementations # Build and install both implementations (user-local)
just build-release just install
sudo just install # This installs to ~/bin/mail2couch-go and ~/bin/mail2couch-rs
# This installs: # Build and install both implementations (system-wide)
# - /usr/local/bin/mail2couch-go sudo just system-install
# - /usr/local/bin/mail2couch-rs # This installs to /usr/local/bin/mail2couch-go and /usr/local/bin/mail2couch-rs
``` ```
--- ---

View file

@ -31,14 +31,39 @@ build-go-release:
# Build optimized Rust release (already built with --release above) # Build optimized Rust release (already built with --release above)
build-rust-release: build-rust build-rust-release: build-rust
# Install binaries to /usr/local/bin (requires sudo) # Install binaries to ~/bin (user-local installation)
install: build-release install: build-release
@echo "Installing binaries to ~/bin..."
mkdir -p ~/bin
cp go/mail2couch-go ~/bin/
cp rust/target/release/mail2couch-rs ~/bin/
chmod +x ~/bin/mail2couch-go
chmod +x ~/bin/mail2couch-rs
@echo "✅ Installed mail2couch-go and mail2couch-rs to ~/bin"
@echo "💡 Make sure ~/bin is in your PATH"
# Install binaries to /usr/local/bin (system-wide installation, requires sudo)
system-install: build-release
@echo "Installing binaries to /usr/local/bin..." @echo "Installing binaries to /usr/local/bin..."
sudo cp go/mail2couch-go /usr/local/bin/ sudo cp go/mail2couch-go /usr/local/bin/
sudo cp rust/target/release/mail2couch-rs /usr/local/bin/ sudo cp rust/target/release/mail2couch-rs /usr/local/bin/
sudo chmod +x /usr/local/bin/mail2couch-go sudo chmod +x /usr/local/bin/mail2couch-go
sudo chmod +x /usr/local/bin/mail2couch-rs sudo chmod +x /usr/local/bin/mail2couch-rs
@echo "✅ Installed mail2couch-go and mail2couch-rs" @echo "✅ Installed mail2couch-go and mail2couch-rs to /usr/local/bin"
# Uninstall binaries from ~/bin
uninstall:
@echo "Uninstalling binaries from ~/bin..."
rm -f ~/bin/mail2couch-go
rm -f ~/bin/mail2couch-rs
@echo "✅ Uninstalled mail2couch-go and mail2couch-rs from ~/bin"
# Uninstall binaries from /usr/local/bin (requires sudo)
system-uninstall:
@echo "Uninstalling binaries from /usr/local/bin..."
sudo rm -f /usr/local/bin/mail2couch-go
sudo rm -f /usr/local/bin/mail2couch-rs
@echo "✅ Uninstalled mail2couch-go and mail2couch-rs from /usr/local/bin"
# Run tests for both implementations # Run tests for both implementations
test: test-go test-rust test: test-go test-rust