mirror of https://github.com/breard-r/acmed.git
				
				
			
			
			
				Browse Source
			
			
			Move the account and certificate default directories
			
				
		Move the account and certificate default directories
	
		
	
			
				Those directories were located in /etc/acmed/, which is not the best choice. According to the Filesystem Hierarchy Standard, they should be located in /var/lib/acmed/. Because systems may have different conventions, those values are now configuration at build time. https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standardpull/47/head
				 7 changed files with 108 additions and 22 deletions
			
			
		- 
					4CHANGELOG.md
 - 
					14Makefile
 - 
					28README.md
 - 
					45acmed/build.rs
 - 
					4man/en/acmed.toml.5
 - 
					33tacd/build.rs
 - 
					2tacd/src/main.rs
 
@ -1,7 +1,40 @@ | 
				
			|||
use std::env;
 | 
				
			|||
use std::path::PathBuf;
 | 
				
			|||
 | 
				
			|||
macro_rules! set_rustc_env_var {
 | 
				
			|||
    ($name: expr, $value: expr) => {{
 | 
				
			|||
        println!("cargo:rustc-env={}={}", $name, $value);
 | 
				
			|||
    }};
 | 
				
			|||
}
 | 
				
			|||
 | 
				
			|||
macro_rules! set_env_var_if_absent {
 | 
				
			|||
    ($name: expr, $default_value: expr) => {{
 | 
				
			|||
        if let Err(_) = env::var($name) {
 | 
				
			|||
            set_rustc_env_var!($name, $default_value);
 | 
				
			|||
        }
 | 
				
			|||
    }};
 | 
				
			|||
}
 | 
				
			|||
 | 
				
			|||
macro_rules! set_specific_path_if_absent {
 | 
				
			|||
    ($env_name: expr, $env_default: expr, $name: expr, $default_value: expr) => {{
 | 
				
			|||
        let prefix = env::var($env_name).unwrap_or(String::from($env_default));
 | 
				
			|||
        let mut value = PathBuf::new();
 | 
				
			|||
        value.push(prefix);
 | 
				
			|||
        value.push($default_value);
 | 
				
			|||
        set_env_var_if_absent!($name, value.to_str().unwrap());
 | 
				
			|||
    }};
 | 
				
			|||
}
 | 
				
			|||
 | 
				
			|||
macro_rules! set_runstate_path_if_absent {
 | 
				
			|||
    ($name: expr, $default_value: expr) => {{
 | 
				
			|||
        set_specific_path_if_absent!("RUNSTATEDIR", "/var/run", $name, $default_value);
 | 
				
			|||
    }};
 | 
				
			|||
}
 | 
				
			|||
 | 
				
			|||
fn main() {
 | 
				
			|||
    if let Ok(target) = env::var("TARGET") {
 | 
				
			|||
        println!("cargo:rustc-env=TACD_TARGET={}", target);
 | 
				
			|||
    };
 | 
				
			|||
 | 
				
			|||
    set_runstate_path_if_absent!("TACD_DEFAULT_PID_FILE", "tacd.pid");
 | 
				
			|||
}
 | 
				
			|||
						Write
						Preview
					
					
					Loading…
					
					Cancel
						Save
					
		Reference in new issue